Report - print medium is not working

Hi,

I’ve a issue in report related to print medium selection.

I’ve a report which will be called from a class, I’ve overridden the dialog method in class and added dialog field, when I run the class dialog appears, on right side of the dialog in current option, when I click Options button and select file as a medium and given the filename and after clicking ok, the Print medium shows still as Screen, its not changing to selected medium(file).

If the report directly called from menu item, it works properly. This issue occurs only when we call the report through class.

Thanks,
Ambanna Yatnal

Hi All,

please can anybody answer this…

Could You paste the code runnign the report? It would be much easier to find the problem…

Are You sure the report is not overriding the print medium if not called from a specific menu item? Do You execute reportRun.init() when running the report by class? How are You passing printJobSettings when running a menu item and when running a report by class?

Regards,

Lukens

Hi Lukens,

class CopyOfReportItemDetails extends RunBaseReport
{
DialogField dlgItemId;
ItemId itemId;
}

public Object dialog(DialogRunbase dialog, boolean forceOnClient)
{
Dialog ret;

ret = super(dialog, forceOnClient);
ret.addField(typeid(itemid));

return ret;
}

public identifiername lastValueElementName()
{
/* identifiername ret;

ret = super();

return ret; */
return reportstr(ReportItemDetails);
}

public boolean getFromDialog()
{
boolean ret;

ret = super();
if(ret)
itemId = dlgItemId.value();

return ret;
}

static void main(Args args)
{
CopyOfReportItemDetails rd;
ItemId itemid;
;
rd = new CopyOfReportItemDetails();

if(rd.prompt())
{
rd.run();
}
}

Report which I have designed is simple one with three fields added to design.

When I run the report, a dialog appears and I click on Options button to choose printmedium as printer but it won’t change in printmedium after selecting printmedium and click ok. But when I create a output menuitem and assign that report to menuitem and run the report that time print medium will work properly.

Regards,
Ambanna Yatnal

You can run the Tutorial_RunbaseReport class and then a dialog will apper, click on Option button another print dialog will appear then select any other option other than default selected one (in left side there are options like screen, E-mail recipient, file, print archive and printer). And click ok but still in print medium previous value only will be there it will not change whatever you have selected in dialog. Please help.

Thanks and Regards,

Ambanna Yatnal

Ambanna Yatnal,

Did you find a solution to this problem since your message posted ?

I have right now the same problem with reports using a class. We found that the problem is there too for class tutorial_runbasereport.

Hi jfmartin,

We can fix this issue by changing code in RunBaseReportDialog class of main method. The prompt is called from the reportRun object instead of the reportDialog object, so need to change the following code,

use

res = reportDialog.prompt(); this line instead of

res = reportRun.prompt();

Ambanna Yatnal

Thank you for your fast answer :slight_smile:

You save me a lot of work to find this problem.

Thanks again.

Its Ok.