How can I print a field that is in the dataset on each page? I added a textbox in the Page Header and use =Fields!ProjectName.value in the value property. I got an error "Fields cannot used in page header and footer."
How can I have the table header shows on each page? Currently if the data goes to the second page, there is no table header.
Thanks.
DanYeung
Hello Dan,
For the table header, right click on the row and go to properties. Change the RepeatOnNewPage property to True.
For the data field, you can add a textbox in your report header and reference the field by the textbox name that it is located in. Like this:
=First(ReportItems!TextBox9.Value)
Hope this helps.
Jarret
|||Hi Jarret,
Thanks for your help. I took care the table header.
For the data field, I added a textbox in the body and the value is =Fields!vchrProjectName.Value . I made the textbox invisible. I also added a textbox in the page header and the value is =First(ReportItems!TextBox9.Value) as you suggested. It printed on the first page only. I think the textbox in the body has no value on the second page, so the textbox in the page header got noghting. What did I missed? Do I have put something in the RepeatWith property?
Thanks.
DanYeung
|||I fixed the page header problem by adding one more table header row before the table header. Added a textbox on the row and used =Fields!ProjectName.value in the value property. Thanks for the idea.
DanYeung
|||I have the same issue and I tried your suggestion by adding the text box in the body and reference that in the page header. Only the first page work, not others. Any other suggestions or I did something wrong?
Regards
Eric
|||You have to add a table in the body. Select the table header row. Change the RepeatOnNewPage property to true. Change the table header background color to while. Add a textbox on the table header and add the field in the textbox. Adding the textbox in the body prints only once. You need the table.
DanYeung
|||Forgive me, I don't understant the second last statement. "Adding the textbox in the body prints only once". Can you explain a little bit more? Also, why to change background color to white?
Best Regards,
Eric
|||Adding a textbox directly in the body won't print on the second page. If you want to repeat on every page, you have to add a table. The default background color for table header is grey. You don't have to change to white if you prefer grey.
DanYeung
|||Hey I couldn't find an easy fix so what I would up doing was creating a report parameter set it as internal so it did not prompt when the report was being created and then for available and default values i selected it as a "from query" and pulled the value from there (with a linked dataset). Works like a charm for me in preview and exporting to PDFs. Here is the XML view of the report I created pulling fields, EmpName, MgrName and EmpPosition as EmpName, MgrName, and Position. The name of my dataset is dsGoals.
Code Snippet
<ReportParameter Name="EmpName">
<DataType>String</DataType>
<DefaultValue>
<DataSetReference>
<DataSetName>dsGoals</DataSetName>
<ValueField>EmpName</ValueField>
</DataSetReference>
</DefaultValue>
<AllowBlank>true</AllowBlank>
<ValidValues>
<DataSetReference>
<DataSetName>dsGoals</DataSetName>
<ValueField>EmpName</ValueField>
</DataSetReference>
</ValidValues>
</ReportParameter>
<ReportParameter Name="MgrName">
<DataType>String</DataType>
<DefaultValue>
<DataSetReference>
<DataSetName>dsGoals</DataSetName>
<ValueField>MgrName</ValueField>
</DataSetReference>
</DefaultValue>
<AllowBlank>true</AllowBlank>
<ValidValues>
<DataSetReference>
<DataSetName>dsGoals</DataSetName>
<ValueField>MgrName</ValueField>
</DataSetReference>
</ValidValues>
</ReportParameter>
<ReportParameter Name="Position">
<DataType>String</DataType>
<DefaultValue>
<DataSetReference>
<DataSetName>dsGoals</DataSetName>
<ValueField>EmpPosition</ValueField>
</DataSetReference>
</DefaultValue>
<AllowBlank>true</AllowBlank>
<ValidValues>
<DataSetReference>
<DataSetName>dsGoals</DataSetName>
<ValueField>EmpPosition</ValueField>
</DataSetReference>
</ValidValues>
</ReportParameter>
No comments:
Post a Comment