I need to make a datareport that supports legal format (8.5 X 14) instead of the usual letter (8.5 X 11). How can I do this? Can anybody help me out here?
I need that the information in the group header of a data report be on the page header, the problem is that the information in the group header are fields from a table and in the page header does not accept these type of information, anybody has an alternate way to do this? I need that info to be the pageheader.
my e-mail is email@example.com
I've never tried using a DataReport to print legal size reports, but I don't know of any way to set a page size. I was under the impression that it just used the settings from the default printer. Will it work if the default printer is set to print legal-sized? If so, you could probably modify the printer in your code to take care of the problem.
As to the group header issue, I have bad news for you: that's simply not possible with the DataReport designer. :( What I did as a workaround was to put labels in the page header which I set at runtime, and then just run a separate report for each group. Not a very nice solution, though. To do more complex reporting, you may want to consider using Crystal Reports or some other third party reporting tool.
05-28-2002, 04:27 PM
u can do this for the report
be sure to set the datamember property to blank
rptreportname.Sections("PageHeader").Controls.Item(x).DataField = rsname.Fields(x).Name
if u do not know the number of fields then use this code
Set .DataSource = Nothing
.DataMember = ""
Set .DataSource = rsname.DataSource
For i = 1 To .Count
If TypeOf .Item(i) Is RptTextBox Then
'The datamember should be always blank while creating dynamic data reports
.Item(i).DataMember = ""
.Item(i).DataField = rsname.Fields(i - 1).Name
Good Luck :)
Thanks for your contribution, although the problem for the paper size is still present, hope more people can help me out here giving me alternate ways to do it posible.
Praveensg: thanks for the code, but can that help me out for putting data from tables for the page header? I'll try it out.
Any more contributions are always welcome.
Praveensg: I'm confused. Unless I'm badly mistaken, the DataReport will not allow you to put RptTextBox controls in the page header section (hence my suggestion about labels). I'm using VB6 -- perhaps this is different in .NET? :confused:
Siu: I'll continue to look into the page size issue. Did you try my default printer settings suggestion?
05-29-2002, 12:06 PM
yeah laura is right
textboxes are not allowed in page header
but i dont think typeof method is supported for labels....
best dont use typeof at all...
go on setting each control item one after the other....
that shud work
i have done sthg like extracting fields from a table and populating page header with the same...
hope it helps
Siu: I verified that my suggestion to change the paper size of the printer will work. As long as the current printer is set to use legal size paper, the DataReport will set its formatting to match. Hope this is what you need.
Yeah, it works, thanks a lot Laura!