Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
174 views
in Technique[技术] by (71.8m points)

c# - How to pass textbox value to crystal reports text object

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...