take report of DataGrid

Stimulsoft Reports.NET discussion
Aqeel
Posts: 6
Joined: Thu Sep 17, 2015 8:12 pm

take report of DataGrid

Post by Aqeel »

Hi dear Engineers

My Data-grid in C# was filled with some information
Now I want when the user for example,choose row 1, and click the print button ... only the data of row 1 send to the report !!!!

thank u
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: take report of DataGrid

Post by HighAley »

Hello.

You could register the data with RegData() method before showing the report.
You should prepare the data in your code and can do it any available way.

Thank you.
Aqeel
Posts: 6
Joined: Thu Sep 17, 2015 8:12 pm

Re: take report of DataGrid

Post by Aqeel »

Thank you for your answering But the problem not solved...:(

I register the data of one row to a dataTable that named "" sr "" with this code:

Code: Select all

getNum = dataGridView1.CurrentRow.Cells["Column2"].Value.ToString();
sr.Clear();
sqlcom.CommandText = "select * from Tbl_Add where Num='" + getNum + "'";
sqlda.Fill(sr);
and this code work correctly.(only the data of a row that i choose send to the sr )

but when i send them to stimul

Code: Select all

stiReport1.RegData(sr);
stiReport1.Show();
Only the information of first line be displayed!!!!

how can i solved this!!?
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: take report of DataGrid

Post by Alex K. »

Hello,

Please try to place the DataBand on the page with your datatable.

Thank you.
Aqeel
Posts: 6
Joined: Thu Sep 17, 2015 8:12 pm

Re: take report of DataGrid

Post by Aqeel »

I'm do it , and when i click the print button the data of all the row in DataGrid is send to the report...

But I don't want this
:(
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: take report of DataGrid

Post by HighAley »

Hello.

What do you need to get? Maybe we don't understand your task.
Could you describe your issue in details with samples?

Thank you.
Aqeel
Posts: 6
Joined: Thu Sep 17, 2015 8:12 pm

Re: take report of DataGrid

Post by Aqeel »

OK!

i hava a DataGrid in visual (c#) like attachment number 1...
and my report view is like picture number 2

i want when the user choose row 1 in DataGrid and click the Print button the result in the report displayed like picture 3

I hope you understand what I want
Attachments
1
1
1.jpg (19.9 KiB) Viewed 3185 times
2
2
2.jpg (55.51 KiB) Viewed 3185 times
3
3
3.jpg (48.29 KiB) Viewed 3185 times
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: take report of DataGrid

Post by Alex K. »

Hello,

Please try to use the following expressions in the Text component:
{DataSourceName.id}, {DataSourceName.name}, etc

where DataSourceName is name of data source which registered in the report.

Thank you.
Aqeel
Posts: 6
Joined: Thu Sep 17, 2015 8:12 pm

Re: take report of DataGrid

Post by Aqeel »

Thank for the answer

the data has been send to the report(this is not the problem(I deliberately wrote the headlines in Photo 2 ))

but the data of all the row in the datagrid is send to the report and i want only one row
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: take report of DataGrid

Post by HighAley »

Hello.

Please, send us your report template with the screen-shots of the report to support@stimulsoft.com for analysis.

Thank you.
Post Reply