Bug Report T295616
Visible to All Users

It is impossible to change ScaleMode and AutoFitPageCount in the DashboardViewer's PrintingOptions

created 9 years ago

I have a dashboardviewer in a windows form. I try to specify the scalemode and autofitpagecount before showing the Print Preview Window but my changes are not taken into account.

PrintingOptions.PageLayout and PrintingOptions.PaperKind both work though.

here is a code sample:

private void button1_Click(object sender, EventArgs e)
 {
            using (MemoryStream xmlStream = new MemoryStream())
            {
                XDocument.Parse("<?xml version='1.0' encoding='utf-8'?><Dashboard><Title Visible='false' Text='Dashboard' /><Items><Grid ComponentName='gridDashboardItem1' Name='Grid 1'><GridOptions /></Grid></Items><LayoutTree><LayoutGroup Orientation='Vertical'><LayoutItem DashboardItem='gridDashboardItem1' /></LayoutGroup></LayoutTree></Dashboard>").Save(xmlStream);
                xmlStream.Position = 0;
                dasboardview.LoadDashboard(xmlStream);
            }

dasboardview.PrintingOptions.AutoFitPageCount = 2;
            dasboardview.PrintingOptions.ScaleMode = DashboardPrintingScaleMode.AutoFitToPageWidth;

dasboardview.ShowRibbonPrintPreview();
 }

Am i missing something?

Show previous comments (2)
DevExpress Support Team 9 years ago

    Hi Alain,
    I have tested this behavior without docking and received the same results in my sample. Would you please provide your sample project to illustrate this  issue?

    AE AE
    Alain Echasserieau 9 years ago

      John,
      i've modified your sample to achieve the same behavior as my project. Please tell me if you still have the same behavior on your end.
      Thanks

      DevExpress Support Team 9 years ago

        Hi Alain,
        Thank you for the provided sample project. It helped me reproduce the problem. I have passed this ticket to our developers for further research.

        Answers approved by DevExpress Support

        created 9 years ago (modified 9 years ago)

        We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.

        Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.

          Comments (3)
          AE AE
          Alain Echasserieau 9 years ago

            Thank you for the hotfix.
            The good news is that now, the behaviour of the docked dashboardview is the same as the non-docked dashboardview.
            Unfortunately, they now both do not work as expected.
            Could you please test my modified sample again and tell me if i'm correct.
            the parameters specified in the sample are as following:
                       dashboardView.PrintingOptions.AutoFitPageCount = 2;
                       dashboardView.PrintingOptions.ScaleMode = DashboardPrintingScaleMode.AutoFitToPageWidth;
            Yet when the showribbonprintpreview() function is called, 6 pages are showing (or 4 depending on the specified pagelayout).

            DevExpress Support Team 9 years ago

              Hi Alain,
              Dashboard tries to save its proportions during export. Thus if you expand a dashboard's width to two pages, its height is expanded accordingly.

              AE AE
              Alain Echasserieau 9 years ago

                Hi John
                Thanks for your answer, I was suspecting something like this.
                I was not sure because in the little video you joined with your first sample (with the exact same dashboard), only 2 pages appear.
                I'm closing the ticket, thanks for your time.

                Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

                Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.