Xojo Reports - How set custom page size, get Page footer to print, etc.

Hello,

In a software, I have developed a small report that will print on two different custom size pages. When printed for the first time it will print on a large size page (8.5 in X 10 in) and when reprinted it will print on a small size page (5.5 in X 7 in).

For this I am trying to set the size of page but cannot set the height. I can only set the width in Report Designer. How to do this?

I am not able to get the Page Footer to print in my custom size page. How to do this?

I have observed that the fields placed in Page Footer are not linking up with the dataset/recordset. I tried an experiment of copying a filed that is place in details section and moved it to the Page Footer and the moment I moved it to Page Footer it started coming blank. Why? Please help.

I have to pint on a pre-printed pages. On this pages the height of the logo is 2.86 inches. How can I say Report Designer to leave a margin of 3 inches and print the header of Report?

The code that I am using is plain simple picked up for the samples that ship with Xojo.

Here is the code:

[code] Dim ps as New PrinterSetup
Dim rpt AS New rptPrescriptions
Dim g As Graphics

Dim sql As String

Dim data As RecordSet

dim ID as Integer

if lst_Prescriptions.ListCount > 0 then
ID =Val(lst_Prescriptions.Cell(lst_Prescriptions.ListIndex, 0))
if ID > 0 then
sql = "SELECT prescription_date AS pDate,prescription_patient_name AS PatName,pd_details AS Med,pd_qty AS Qty,pd_dose As Dose,prescription_instructions AS ExtraInfo, prescription_diagnosis AS Diagnose, prescription_next_date AS NextDate FROM prescription INNER JOIN prescription_details ON prescription.prescription_id = prescription_details.pd_prescription_id WHERE prescription_id = " + Str(ID)

  data = App.mDB.SQLSelect(sql)
  
  If App.mDB.Error Then
    MsgBox("DB Error: " + App.mDB.ErrorMessage)
    Return
  End If
  
  If data <> Nil Then
    if data.RecordCount > 0 then
      win_PrintPreview.ReportPreviewContainer1.ShowReport(rpt, data)
      win_PrintPreview.ShowModalWithin(win_ManagePrescription)
    Else
      MsgBox("There are no Prescription(s) to print")
    end If
  Else
    Beep
    MsgBox("No records found to print.")
  End If
end If

end if

lst_Prescriptions.SetFocus[/code]

Please help solve these problems.

TIA

Yogi Yang

I forgot to mention that I have also facing trouble in getting the Report to print the Data in dd/mm/yyyy format. Please also help solve this problem.

TIA

Yogi Yang

I think my first post is not that clear. I will try to rephrase it one by one:

  1. How to set Custom Page Size in the built in Report Designer of Xojo?
  2. How to change the size of page at run-time. Here what I need to do is set the height of paper, top & bottom margins.
  3. The Report Engine is not printing any Report Field placed in Page Footer. Why and How to solve this?
  4. If we print any date in Report Field the date gets printed in yyyy/mm/dd format. Instead I want to print it in dd/mm/yyyyy format. How to do this?
  5. If we place Report Date Label in the report and how can we get it to print out the date from database?
  6. I have to print the final report on a pre-printed page on printer. For this I need to set the Top and Bottom Margins of the Report but I am not able to find any property that allows me to set them.

Please help.

TIA

Yogi Yang