web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

How to set width page break for Dot Matrix continuous SSRS landscape report?

(0) ShareShare
ReportReport
Posted on by 1,813

Hii,

I have a SalesInvoice report printing from Dynamics AX 2012.

Its a pre-printed and continuous dot matrix report with three multi color carbon copies. 

Physical size of the report that I measured with ruler. Please see the images.
Width: 12.1 inches
Height: 8.3 inches

Printer: EPSON LQ-690

Problems facing and struggling for two weeks. 

a) One page prints ok. But If page set a cm left or right, all alignment disturbs.
b) If more than one page, the second page starts from extreme left corner. Ignoring left padding that disturbs left alignment?
c) The tablix columns are not coming exactly under pre-printed columns?
d) After long struggle I changed report width from 12.1 inches to 14.0 inches, then at least columns are printing in alignment.
e) Mostly table expanding horizontally to next page.

Please help why page physical with and report width do not match. Continuous pages moving to left. All alignment disturbing.ssrs-report.jpg

ssrs-settings.jpg

*This post is locked for comments

I have the same question (0)
  • Chandra Wijaya Setiawan Profile Picture
    1,145 on at
    RE: How to set width page break for Dot Matrix continuous SSRS landscape report?

    I have this issue before but unfortunately i dont have access as i moved on to new company.

    There is an issue with SSRS engine in AX when detecting width>Length it will overwrite to landscape although you want EPSON to recognize it as portrait (dot matrix driver partly to blame).

    I remember i need to overwrite the setting to portrait before printing after SSRS brutally overwrite the setting to landscape.

    So you must debug when SSRS forced it to landscape and force it back to Portrait right before printing.

    And please note you will need to put destination directly to printer (can't preview to screen first as the kernel for print preview will force to landscape again).

    So what i did is i gave two button to user preview to screen (standard) and print to printer (by forcing back the to portrait  before sending to printer).

    Good luck.

  • Rana Anees Profile Picture
    1,813 on at
    RE: How to set width page break for Dot Matrix continuous SSRS landscape report?

    Thanks Chandra,

    I have a Custom Page size in my SalesInvoice SSRS report that is W=12in and Height=8.5in, Layout=LandScape

    In my EPSON LQ-690 dot matrix printer I have created the same custom size.

    In AX 2012 R2 when I see SalesInvoice report Print preview is shows in Portrait not  landscape on a client PC that is using Windows 10.

    To make a test I share EPSON LQ-690 dot matrix printer from windows 10 pc and send print from windows 8 pc and its printing landscape and its ok.

    I reinstalled printer driver, installed again windows 10 driver but same results.

    How and where in X++ code I can force salesinvoice report layout to landscape?

    Thanks

  • Andrew Xu Profile Picture
    3,877 on at
    RE: How to set width page break for Dot Matrix continuous SSRS landscape report?

    Chandra,

    I had this issue too and didn't find a good solution. If you can recall and share the solution that will be great!

  • Chandra Wijaya Setiawan Profile Picture
    1,145 on at
    RE: How to set width page break for Dot Matrix continuous SSRS landscape report?

    You can refer to code below as reference only as i dont have access to that customer anymore.

    Below code is to print to pdf but you should change the medium to printer instead.

    The important things is you should always set your paper orientation to portrait so below code is important.

        printersettings.landscape(false);

    Below is printing to the file but you need to change the medium to printer.

    public static fileName  PDFGenerate_SalesInvoice(custinvoicejour _custInvoiceJour, FilePath _filePath)
    {
        SalesInvoiceContract            salesInvoiceContract   = new SalesInvoiceContract();
        SrsReportRunController          ssrsController = new SrsReportRunController();
        SRSPrintDestinationSettings     printerSettings;
        FileName                        fileName;
    
        ;
        if(!_custInvoiceJour.RecId)return fileName;
    
    
    
        //tell the controller the report to run (filename, design name)
        ssrsController.parmReportName(ssrsReportStr(SalesInvoice, Report));
        //define how we want to execute the report (right now or batch style)
        ssrsController.parmExecutionMode(SysOperationExecutionMode::Synchronous);
        //hide the report dialog
        ssrsController.parmShowDialog(false);
    
        //we need to populate the required parms for the current sales order controller
        salesInvoiceContract.parmRecordId(_custInvoiceJour.RecId);
        salesInvoiceContract.parmCountryRegionISOCode(SysCountryRegionCode::countryInfo());
        salesInvoiceContract.parmPrintCopyOriginal(PrintCopyOriginal::Original);
    
        //link the contract to the controller so we know how to run the dp
        ssrsController.parmReportContract().parmRdpContract(salesInvoiceContract);
    
        //link the printer settings to the controller
        printerSettings = ssrsController.parmReportContract().parmPrintSettings();
        //print to pdf and always overwrite if the file exists
        printerSettings.printMediumType(SRSPrintMediumType::File);
        printerSettings.fileFormat(SRSReportFileFormat::PDF);
        printerSettings.overwriteFile(true);
        printersettings.landscape(false);
    
        fileName    =  _filePath  + _custInvoiceJour.InvoiceId + "_" + _custInvoiceJour.SalesId + "_" + _custInvoiceJour.InvoiceAccount + ".PDF";
    
        printerSettings.fileName(filename);
    
        try
        {
            //run & save the report
            //ssrsController.startOperation();
            ssrsController.runReport() ;//refer to update at top of page
        }
        catch(Exception::Error)
        {
    
            Warning(strFmt("Error on saving report PDF, make sure SSRS server is valid, %1 / %2" , _custInvoiceJour.SalesId, _custInvoiceJour.InvoiceId));
        }
        return fileName;
    
    }


  • Chandra Wijaya Setiawan Profile Picture
    1,145 on at
    RE: How to set width page break for Dot Matrix continuous SSRS landscape report?

    Dot matrix driver definition about landscape and portrait is a bit weird.

    and combination with SSRS will be confusing.

    As i mentioned avoid to have print preview then print as the print preview kernel and dot matrix doesn't like each other.

    Create a special method to directly print to printer (medium printer). then control the page orientation before sending to printer.

  • Chandra Wijaya Setiawan Profile Picture
    1,145 on at
    RE: How to set width page break for Dot Matrix continuous SSRS landscape report?

    Sorry just to add i think what i did when print to screen i set portrait and print to printer i set landscape or vice versa.

    But honestly this is only hint as i can't remember the code exactly so you still need to play around with it.

  • Verified answer
    Rana Anees Profile Picture
    1,813 on at
    RE: How to set width page break for Dot Matrix continuous SSRS landscape report?

    After a few weeks struggle, Found following solution,

    1. Measure your preprinted page with ruler like we have for continuous preprinted pages for sales invoice

    2. Give your SSRS report same Width and Height as your preprinted page has. Properly give left and right margins. If page size is not A4 or Letter etc then it will be custom design

    3. Always keep in mind this formula. Report total width = Body width + Left margin + Right margin

    4. If your SSRS report size is Custom then create the same Page Size in your Dot Matrix printer (Control panel -> printer and devices -> locate your dot matrix printer -> Printer preferences and properties and create new page size)

    5. If your SSRS report Width = 12.5in and Height = 8.6in then your dot matrix printer custom size Width = 8.6in and Height =

      12.5in . This was the point I was doing mistake

    6. You have to find physical paper feed location on your dot matrix printer and tell to all your users strictly follow that. If you put your page a cm left or right, your printing will not be aligned according to the preprinted format

    Thanks,

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Community Member Profile Picture

Community Member 4

#2
Nayyar Siddiqi Profile Picture

Nayyar Siddiqi 2

#2
Guy Terry Profile Picture

Guy Terry 2 Moderator

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans