Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dont't print the report field

Status
Not open for further replies.

lutzs

Programmer
Oct 8, 2002
75
LU
Hi,

I add a field of my dataset in the crystal report (.net application).
When I click a button I print this report.
But the dataset field isn't printed at my report!

For control, I get out the field with a MessageBox.Show and the value is correct.

What is the problem?
I work with MS Visual Studio.net and Crystal Reports 9.0.

Thanks, Stephanie


 
Are you passing a DataTable to a Crystal Report through .NET code (C#?) ?
If so you need to ensure that the required field is set up in the crystal report file (.rpt) as appropriate else it won't be displayed.
Is it as simple as this.
If not can you try to shed some more light on the issue so we might help.
Steve
 
Hi,

thank you for your answer.
Yes, I'm passing a DataTable to a Crystal Report (C#):

header crReportDocument = new header();

// the DataSet
programmname ds_pname = new programmname();
DataTable t_pname = new DataTable();

DataColumn myDataColumn = new DataColumn();
myDataColumn.ColumnName = "name";
myDataColumn.DefaultValue = Application.ProductName;

t_pname.Columns.Add(myDataColumn);

// add table to the dataset
ds_pname.Tables.Add(t_pname);

// add datatable to CrystalReport
crReportDocument.SetDataSource(t_pname);

crReportDocument.PrintToPrinter(1, true, 1, 1);
...


The required field is set up in the rpt- file.

Can you help me?

Stephanie


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top