This is a migrated thread and some comments may be shown as answers.

No data in viewer, but on export, data shows up

1 Answer 89 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jay
Top achievements
Rank 1
Jay asked on 19 Mar 2008, 02:29 PM
I have a report, that is databound from code behind.  In order to set up the report quickly, i used the report wizard

During the Wizard setup, I provide it with the SQL query from my stored procedure, minus the parameters.

Once the report is designed, i then sever the link to the DataTableAdapter that was created by the wizard

In the need datasource method of the report, i provide it with a data table that is filled from my sqlcommand

In the report, i remove the link to the datasource that was referenced from the wizard

when i run the report, no data is shown in the viewer, however when i export to PDF or Excel, the data is shown.

am i missing a configuration?  Do i have to do it completely from code behind?...i hope not

obviously when i go into the value of the textbox, and look at the fields, there is no field data...

please help me shed some light as to what i am doing wrong

Thanks

1 Answer, 1 is accepted

Sort by
0
Jay
Top achievements
Rank 1
answered on 19 Mar 2008, 02:44 PM
I figured it out...strange how it works this way only, and not how i tried it initially...

Instead of setting the datasource in the Need Datasource method of the report object, I set the report's datasource in the calling class before assigning the report to the viewer

In my eyes, it was cleaner the way I did it initially
Tags
General Discussions
Asked by
Jay
Top achievements
Rank 1
Answers by
Jay
Top achievements
Rank 1
Share this question
or