Printing
Posted: Sun May 20, 2007 4:56 pm
Hi
What is 'the' recommended way to print and to preview more than one chart on a page, without running into problems with strange fonts, line sizes, etc. What is the recommended example I should study?
I have read most of the questions/answers about printing, but after hours of reading and trying and frustration, I know I have to ask for help. I am using VS2005, C++, native, Teechart Pro 7.0.0.5 ActiveX.
I have dynamically created two Charts and I am able to update the charts, and view and browse large data files.
Now I want to preview and print these charts, i.e. I want to put the charts on a page, and combine the charts with other elements , such as header and footer texts.
In the Create of a Class inherited from CView I defined the two charts (Classes inherited from CTChart)
CChart * pChart = new CChart( GetDocument() );
pChart->Create(lpszClassName,"", dwStyle, CRect(0,0,50,50), this, IDC_TCHART1, pContext);
pChart->AttachControlSite(this); // ?? is this really necessary?
m_chartarray.Add( pChart );
in the OnSize function I position both Graphs in the View. Works fine, and flexible
What is THE recommended way to preview and print the charts on the same page, with the best quality output (fonts, ticks on axis, etc.). I saw the Printing example but the output of that example creates poor quality charts (background, grid, fonts etc.).
I tried using CTeePreviewPanel. I created a dialog (CPrintPrevDlg), inserted the activeX component, added a control variable (m_PrintPrev), and I tried to use the recommended? example I saw in another post on this forum.
CPrintPrevDlg PrevDlg;
CChart * pChart = m_chartarray[0];
pChart->GetPrinter().SetPrintProportional(false);
pChart->GetPrinter().SetMarginLeft(2);
pChart->GetPrinter().SetMarginTop(2);
pChart->GetPrinter().SetMarginRight(40);
pChart->GetPrinter().SetMarginBottom(40);
pChart->GetPrinter().SetDetail(100);
PrevDlg.m_PrintPrev.AddChartLink(pChart->GetChartLink());;
PrevDlg.DoModal();
But now nothing happens, I see the Preview dialog, I see the PrintPrev Canvas with the margin lines, I can drag these lines, but there is no chart or signal displayed. And I still do not know whether this approach will provide the best quality prints or that I should try another strategy.
Your help is greatly appreciated..
What is 'the' recommended way to print and to preview more than one chart on a page, without running into problems with strange fonts, line sizes, etc. What is the recommended example I should study?
I have read most of the questions/answers about printing, but after hours of reading and trying and frustration, I know I have to ask for help. I am using VS2005, C++, native, Teechart Pro 7.0.0.5 ActiveX.
I have dynamically created two Charts and I am able to update the charts, and view and browse large data files.
Now I want to preview and print these charts, i.e. I want to put the charts on a page, and combine the charts with other elements , such as header and footer texts.
In the Create of a Class inherited from CView I defined the two charts (Classes inherited from CTChart)
CChart * pChart = new CChart( GetDocument() );
pChart->Create(lpszClassName,"", dwStyle, CRect(0,0,50,50), this, IDC_TCHART1, pContext);
pChart->AttachControlSite(this); // ?? is this really necessary?
m_chartarray.Add( pChart );
in the OnSize function I position both Graphs in the View. Works fine, and flexible
What is THE recommended way to preview and print the charts on the same page, with the best quality output (fonts, ticks on axis, etc.). I saw the Printing example but the output of that example creates poor quality charts (background, grid, fonts etc.).
I tried using CTeePreviewPanel. I created a dialog (CPrintPrevDlg), inserted the activeX component, added a control variable (m_PrintPrev), and I tried to use the recommended? example I saw in another post on this forum.
CPrintPrevDlg PrevDlg;
CChart * pChart = m_chartarray[0];
pChart->GetPrinter().SetPrintProportional(false);
pChart->GetPrinter().SetMarginLeft(2);
pChart->GetPrinter().SetMarginTop(2);
pChart->GetPrinter().SetMarginRight(40);
pChart->GetPrinter().SetMarginBottom(40);
pChart->GetPrinter().SetDetail(100);
PrevDlg.m_PrintPrev.AddChartLink(pChart->GetChartLink());;
PrevDlg.DoModal();
But now nothing happens, I see the Preview dialog, I see the PrintPrev Canvas with the margin lines, I can drag these lines, but there is no chart or signal displayed. And I still do not know whether this approach will provide the best quality prints or that I should try another strategy.
Your help is greatly appreciated..