Yanis Saadi

Yanis Saadi

  • NA
  • 6
  • 539

What wrong with my code, An error occurred local report

May 10 2020 8:16 PM
Hi
 
this is the error : 'An error occurred while processing the local report
  1. NullReferenceException : Object reference not set to an instance of an object  
 So i thing the problem is with this line :
  1. FrmRpt.RPAfficher.LocalReport.ReportEmbeddedResource = "GestionDeStock.RAP.RP_Produit.rdlc";  
and this is my code : 
  1. FrmRpt.RPAfficher.LocalReport.ReportEmbeddedResource = "GestionDeStock.RAP.RP_Produit.rdlc";  
  2. ReportParameter PCat = new ReportParameter("RP_Categorie", Nom_Categorie);  
  3. ReportParameter PMarque = new ReportParameter("RP_Marque", Product.Nom_Produit);  
  4. ReportParameter PCouleur = new ReportParameter("RP_Couleur", Product.Couleur_Produit);  
  5. ReportParameter PTaille = new ReportParameter("RP_Taille", Product.Taille_Produit.ToString());  
  6. ReportParameter PQuantite = new ReportParameter("RP_Quantite", Product.Quatite_Produit.ToString());  
  7. ReportParameter PPrix = new ReportParameter("RP_Prix", Product.Prix_Produit.ToString());  
  8.   
  9. string ImageString = Convert.ToBase64String(Product.Image_Produit);  
  10. ReportParameter PImage = new ReportParameter("RP_Image", ImageString);  
  11.   
  12. FrmRpt.RPAfficher.LocalReport.SetParameters(new ReportParameter[] { PCat, PMarque, PCouleur, PTaille, PQuantite, PPrix, PImage });  
  13. FrmRpt.RPAfficher.RefreshReport();  
  14. FrmRpt.ShowDialog();  
HELPPPPP please :'( 
 
have a nice day 
 

Answers (3)