I created crystal reports file and set up everything i wanted to.I made a couple of empty text objects and i want to pass values to them from my,comboboxes,richtextboxes and textboxes.I changed their names in properties but i couldnt find a way to pass values to them.When i use setparametervalue i get error "invalid index..." something like that.I would be grateful if someone can help me.Thanks in advance.
PrintDialog printDialog = new PrintDialog();
if(printDialog.ShowDialog()==DialogResult.OK)
{
CrystalDecisions.CrystalReports.Engine.ReportDocument reportDocument = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
reportDocument.Load(@"C:...CrystalReport1.rpt");
reportDocument.SetParameterValue("textobject", textbox.text);
reportDocument.PrintOptions.PrinterName = printDialog.PrinterSettings.PrinterName;
reportDocument.PrintToPrinter(printDialog.PrinterSettings.Copies, printDialog.PrinterSettings.Collate, printDialog.PrinterSettings.FromPage, printDialog.PrinterSettings.ToPage);
question from:
https://stackoverflow.com/questions/65837622/how-to-pass-textbox-value-to-crystal-reports-text-object 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…