Page Layout for multiple records

Posted by: jriley on 18 June 2018, 2:44 am EST

    • Post Options:
    • Link

    Posted 18 June 2018, 2:44 am EST

    Attached is a report that will display correctly if only 1 record is returned but we want to be able to return multiple records. The report contains 2 pages and we want record2 thru the end of the recordset to match the 1st two pages. The problem is that the pages start running together and the information is not in the same location.

    Any suggestions?Report.zip

  • Posted 18 June 2018, 9:03 pm EST

    Hello,

    Could you please explain your requirement in detail with screenshots. Also, I got the error on previewing the attached report. Please share the report that can run at my end.

    Thanks,

    Mohit

  • Posted 20 June 2018, 7:38 am EST

    I have most of the issues resolved with the report but unable to fix the remaining issue. Added grouping to the report which separates things like I was hoping. However, as you look at the PDF, Page 2 doesn’t display the right CU name.

    Unsure of how to get you a working report file. I just saved the layout via visual studio.

    Any suggestions on how to solve this problem?

    MyPDF (1)_Redacted.zip

  • Posted 20 June 2018, 7:53 pm EST

    Hello,

    Could you please drag drop the “CU name” field in “Detail” section and set its “Visible” property to false. After that, in PageHeader’s “Before Print” method, you set the value of “Cu Name” in Page header to the value of “Cu Name” in Detail section. Please refer the following code:

    
    public void PageHeader_BeforePrint()
    {
    	// CU Name field in page header = CU Name Field in detail 
    	this.txtCustomerID2.Value = this.txtCustomerID1.Value;
    }
    
    
    

    Also, refer the demo report implementing the same.

    Hope it helps,

    Thanks,

    Mohit

    rpt_Sever.zip

  • Posted 21 June 2018, 5:37 am EST - Updated 30 September 2022, 6:55 am EST

    I did as you suggested but pages 2+ do not have a CUName in the Page Header although my hidden field is populated on page 2 but not any other. Here is my code.

    Public Function ActiveReport_FetchData(byval eof as boolean) as boolean
    	
    	ds = DataSet
    	rpt.fields("rptdate").value = Now()
    	
    	rpt.Fields("rptName").value = rptName
    	
    	If rowsCounter < ds.Tables(0).Rows.Count Then   
    		eof = False  
    		dr = ds.Tables(0).Rows.Item(rowsCounter) 
    			rpt.fields("cuname").value	= ucase(Trim(dr("cuname")))
    			'rpt.fields("txtcuname1").value = ucase(Trim(dr("cuname")))
    			rpt.fields("asinum").value = "ASI:  " & dr("asinum")
    		rowsCounter = rowsCounter + 1
    
    	Else  
    		eof = True
    	End If
    	Return eof
    	
    End Function
    
    
    Sub PageHeader_BeforePrint
    	rpt.fields("cuname").value = rpt.fields("txtcuname1").value
    	rpt.fields("asinum").value = rpt.fields("txtasinum1").value
    End Sub
    

  • Posted 21 June 2018, 3:37 pm EST

    Hello,

    Could you please provide me the report which can be run at my end as previously attached report shows error on previewing. This will be very helpful for us to provide you the suitable solution for your application.

    Thanks,

    Mohit

  • Posted 25 June 2018, 2:17 am EST

    I am including a project file that you should be able to use. I was unable to get the data source connected but the data is within the file. PageReportApplication2.zip

  • Posted 25 June 2018, 9:48 pm EST

    Hello,

    I have modified the report according to the your requirement. I have placed “cuname” and “asinum” field in “PageFooter” and set them visible and add following line of code in PageHeader’s “Before Print” event.

    
    
    Sub PageHeader_BeforePrint
    Me.Field8.Value	= Me.TextBox1.Value
    	Me.Field348.Value	= Me.TextBox2.Value
    End Sub
    
    

    Please refer the modified sample. Also, refer the PdF output file.

    Hope it resolves your issue.

    Thanks,

    Mohit

    Report_modified.zip

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels