|
-
May 3rd, 2016, 07:16 AM
#1
Thread Starter
New Member
Database Fields in VB6 Data Report Header and Footer
I am outputting data in a data report that needs to be placed in the page header and need to output information in the report footer that does math on another field in the footer.
The header needs to have data that shows the version of the report being printed, but may be revisable by the administrator of the software. I did this by placing the information in an Access table (all data is in Access) that only the administrator can modify.
However, I can not place a text box in the header to get the data from a SQL query that the report is linked to. Is there any workaround for this issue.
Also in the footer I need to show 10%, 20% 80% and 100% of the sum of one of the columns in the report. I can get the 100% using the sum report function, but no way to reference that multiplied by the appropriate fraction.
This is for a project I need to finish this week and I can find no way to achieve what I need. Any help would be greatly appreciated!!
-
May 3rd, 2016, 02:07 PM
#2
Re: Database Fields in VB6 Data Report Header and Footer
Adding Date, Time, Page Number, and Title to the Data Report shows the limits of "variable" information in Report and Page Headers and Footers.
What you want can't readily be done. You need either a 3rd party report writing library or else you need to roll your own from scratch.
This is why it helps to understand a tool before plowing ahead with it and getting too far down the road where you hit a dead end.
-
May 3rd, 2016, 02:17 PM
#3
Re: Database Fields in VB6 Data Report Header and Footer
If you are desperate you can try altering the values of DataReport Labels within the DataReport:
Code:
Private Sub DataReport_Initialize()
With Sections("PageHeader").Controls
.Item("lblHeadFrom").Caption = Format$(Form1.ReportBetween.FirstDate, _
"mmmm d, yyyy")
.Item("lblHeadThrough").Caption = Format$(Form1.ReportBetween.LastDate, _
"mmmm d, yyyy")
End With
End Sub
But there is nothing more "automagic" than that available, i.e. there isn't any data binding support in these Headers/Footers.
Perhaps that gives you enough control for what you need?
-
May 4th, 2016, 07:29 AM
#4
Thread Starter
New Member
Re: Database Fields in VB6 Data Report Header and Footer
 Originally Posted by dilettante
Adding Date, Time, Page Number, and Title to the Data Report shows the limits of "variable" information in Report and Page Headers and Footers.
What you want can't readily be done. You need either a 3rd party report writing library or else you need to roll your own from scratch.
This is why it helps to understand a tool before plowing ahead with it and getting too far down the road where you hit a dead end.
Thank You for your help. I will give your second suggestion a try.
Unfortunately I was given no choice in the report design. User needs to be able to edit values located in the header of the report. The only way I know is to provide editable date in the database, which leaves me needing to put data in the header not just functions.
-
May 4th, 2016, 05:04 PM
#5
Re: Database Fields in VB6 Data Report Header and Footer
If you use the approach from post #3 above, the source of the data can be anything visible to DataReport code. That includes things like the properties of controls on a Form, global data items, disk file data, values you retrieve using a query, etc.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|