Dynamic Report c#

Asked

Viewed 853 times

2

I am preparing a report with the following structure:

inserir a descrição da imagem aqui

Well so far everything is set right, I’m using C# Windows Form, using the Reportviewer component to do the report, but when it comes to getting the data, it only takes the information from the first record, wanted it to generate a record of this per page, with the information for each data specified on the line, this having a button also above to list only the data of certain events in certain cities.

I’m at a point where I don’t know how to code this and it wouldn’t work to put it on a table, Matrix or list.

I wonder how to make such a page break for each record.

2 answers

1

@SNOT, you must use the "Header" to place the content or "[Name]", and the other items in the "Subtotal", and configure the report to perform the break by name, since your query is passing the fields Name, Localpackaging, data_hora_event.

The "Body" you can leave blank, I do not remember if deleting it will work, but worth testing.

att

LMV

Suppose you have the following:
[NAME]-----------[data_hora_event]-------[localEvento]----[room]
Luiz Marcelo.... 2015-07-01 09:00...... Hotel Xyz......
Luiz Marcelo.... 2015-07-01 10:00...... Hotel Xyz......
Francisco M........ 2015-07-01 09:00...... Hotel Xyz...
Francisco M........ 2015-07-01 10:00...... Hotel Xyz...

But you do not want the room, so you use the subtotal resource, which will indicate only one [NAME] and [Localevent].

  • I could not understand very well, how it works to put them in subtotal?

  • @SNOT, come on, in the report is created a header, the body of the report and the total and to complement, can add other structures as the sub-total. So if you hide the body of the report (body) you will have Cabçalho (header) and Subtotal. Placing the page break in subtotal when display will be printed on each page, the header, the Subtotal, template you want. .

  • @SNOT, at a glance, did a quick search https://code.msdn.microsoft.com/windowsdesktop/Gerando-relatrios-com-815c3396

  • well this example is very basic and would not serve, because in the way I showed, it is not using table, to get all the values related to that. As it would be a data per page he can not recognize that there are others and send to the next page, not so much the break of page as the method of doing in the header are working

0


Well, I got it, if anyone wants to answer it. I made the following method:

To be able to display all records it is necessary to have a 'data Region' (table, list or Matrix). Then I just created a table with 3 lines and 1 column, and organized it as if it were my 3 text box, and then in the Static properties I let you hear the page break. So repeating on all pages with all records and filtering options.

Grateful to those who can help me.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.