|
There is no support for multipage templates, you'll just have to split them in several individual pages.
|
|
|
|
|
Hi,
Is it possible to do something like the following:-
Have an (e.g.) A4 sized template, A.
Have multiple smaller sized templates, B, C, D.
Load A via SetReportfile.
Load B via AddTemplate and then position it to appear in page A at a specified place.
Ditto for C and D, etc, etc.
I.E. B, C and D are regions that appear on a specified page or all pages, but they can be designed in the report creator as individual templates.
If this is possible it would provide greater design flexibility and ease, and element re-use.
Many thanks for all your hard work!
Richard
|
|
|
|
|
In code, this would be trivial to accomplish, just add objects to a given template. Selecting the appropriate template is however a little bit more complicated. Best would of course have to have a specific draw object that loads another template, this would be implemented in CFieldFactory where this hypothetical "CDrawTemplate" would - if instantiated - continue to create objects until the template is read through. It's indeed doable, perhaps you volonteer?
|
|
|
|
|
Heh, OK, I'll volunteer, but due to workload don't expect miracles (or indeed anything for a while).
If its ok can you email me at richard at vale-tech dot co dot uk and I'll be in touch with questions when I've had a chance to familiarise myself with the class designs?
Cheers,
Richard
|
|
|
|
|
Trying to create a report where each page has the same template (of type TEMPLATE_TYPE_SECTION) :
for( int j = 0; j < nPages; j++ )
{
pReport->AddTemplate( sTitleFile, TEMPLATE_TYPE_SECTION );
int max = pReport->GetTemplateSize( j );
for( int i = 0; i < max; i++ )
{
sField = pReport->GetFieldName(i, j);
iType = pReport->GetFieldType( sField, j );
if( iType == FIELD_TYPE_FIELD )
{
// Perform fields substitution here
pReport->Add( sField, s );
}
}
}
and not being able to find a solution, I've modified CReportGenerator, changing the Add method for fields from
BOOL Add( const CString & field, const CString & data );
to
BOOL CReportGenerator::Add( const CString & field, const CString & data, int tplate = -1 );
and, inside the method, changed
CDrawField* obj = dynamic_cast< CDrawField* >( GetObject( field ) );
with
CDrawField* obj = dynamic_cast< CDrawField* >( GetObject( field, tplate ) );
so now I can use the Add method in this way
pReport->Add( sField, sValue, iTemplateNo );
indicating in which template the field has to be substituted.
|
|
|
|
|
I'm not sure I follow what you are trying to accomplish - to have a report where each page uses the same template is already catered for? The latter part of you post seems to indicate that you have several templates, could you please elaborate?
|
|
|
|
|
May be this features is just provided (to have a report where each page uses the same template), but I did not know how to accomplish that with a template whit no grids which could span through pages.
However, using different templates for each page, which may have fields with the same name, and do a fields substitution targeting a single template/field pair was not possible , without changing the Add method.
May be I am wrong !
|
|
|
|
|
For what I assume you want to do, I would actually go for a much simpler solution. For single-template printouts, I would load the template, and then start to loop that data to print out. for each instance of the data, I would do a Clear (which clears the data, but not the template), fill the fields and then a Print.
If I would use different templates, I would most definitely treat them as separate reports, loading a template, setting data, printing etc. in a loop until the data was exhausted. To have a collection of different templates in the way I understand you like to do is not supported (that is, where you chose what template to add data to - I assume you also want to selectively print out data).
|
|
|
|
|
I can't understand how column' widths in a grid work !
When adding a column into a grid the width proposed is "1.#J" which I don't know the meaning.
When confirmed, in the listbox, that column has a width of "0.99".
If I try to change this width, and confirm the same value ("0.99"), then, in the listbox, the width change to "1.02".
I'm a bit perplexed !
How does it works ?
Thanks
|
|
|
|
|
1.#J is an uninitial value of some kind, plainly a bug. That the value gets a little bit different depends on the measurements set - internally, inches are used (as they are the standard in the typographical business), and there will be rounding errors between this and centimeters/pixels.
|
|
|
|
|
Hi,
First, excellent code.
I have notice the same problem, it happens only when measurement is in centimeters.
Also when enter the value for the column width (in centimeters) in the size value shows 1/"Entered value", i.e.:
Entered value = 5, size shows 0.2 (1/5 = 0.2)
Entered value = 3, size shows 0.33 (1/3 = 0.3333...)
Entered value = 10, size shows 0.1 (1/10)
The problem is in CUnitConversion::PixelsToCentimeters method
return pixelspercentimeter / static_cast< double >( pixels );
It should be
return static_cast< double >( pixels )/pixelspercentimeter ;
Thanks, Great work.
Habetis bona deum
|
|
|
|
|
It a nice code but I try to test Compile ReportGeneratorDemo (I download and Run it ok.) after I create report file (rpt1.rpt) by ReportCreator.exe and save rpt1.rpt file to folder c:\rpt and add image type bmp name logo.bmp
if open report in reportCreator it can see image on print preiview
but I open rpt1.rpt in ReportGeneratorDemo (source code and build it)
It work only when run CFiledialog before set SetReportfile function
I modify this
....
CFileDialog dlg( TRUE, _T( "rpt" ), _T( "*.rpt" ) );
dlg.DoModal();
// Only DomoDal but not select rpt1.rpt ()
CString strstrRptFile;
strRptFile.Format("c:\\rpt\\RPT1.rpt");
if( m_reportGenerator.SetReportfile( strRptFile ) )
{
....
}
It can show any things ok
but if you comment dlg.DoModal(); or show domodal but click cancel
It can show any label and filed but not show image
Why??
I must sure image file is same locate in folder rpt
Thanks
kritsakon.
|
|
|
|
|
kritsakon,
I recommend that you download an read the documentation, it took quite som time to write
You'll find the following information on images:
Images
Image objects will draw images on the report. Only BMP:s and DIB:s are supported, and they must be located in the same directory as the template during printout. Although this is not necessary during editing, it might be easiest to save the template to the same location from the beginning. When loaded with a picture, the image object will resize itself to the size of the picture. It can be resised to the desired size the same way as any other object.
|
|
|
|
|
... but I don´t know what it is
Here are the steps to reproduce it:
Make a sample report with two grids: one small at the top (say, 3 lines), one over the rest of the page.
Open the report in the demo exe an provide, say, 55 lines for the first grid, 555 lines for the second grid.
Scroll to the end -> crash.
Another thing:
I can´t figure out how to setup a master/detail report.
Things should look like this:
Header
Master Grid
Detail Grid
Detail Grid
Detail Grid
Master Grid
Detail Grid
...
Footer
Think you got it.
yoko
|
|
|
|
|
I'll look into the crash - an example rpt-file where this happens wouldn't go amiss!
|
|
|
|
|
Dear Sir,
When I draged scroll bar thumb and the position over around 400, the thumb will go back to "0" even paper size was set to be over 400.
Thanks,
|
|
|
|
|
It's a little bit scant on information, this, I'll need some clarifications:
I assume that it is the ReportCreator we speak of? What measurements are you using? Give - if possible - a step-by-step instruction on how to repeat this problems.
|
|
|
|
|
Dear Sir
Thank you very much for your reply.
Just drag the scroll bar thumb to the end of the scrollbar. The thumb go back to starting position, it will not stay at the end of the Scrollbar.
Thank you very much,
|
|
|
|
|
If you mean the effect that if you move the mouse cursor too far from the thumbtack, the thumb snaps back to the beginning, then it's something you'll find for all scrollbars - try for example WordPad with more than a screen of text. If not, I'm still not sure what you mean - more details needed.
|
|
|
|
|
Hi
Sorry to bother you again.
I tried to use following FolderTabControl with your CDiagrameditor.
http://www.codeproject.com/tabctrl/foldertabcontrol.asp
From MSDN Paul DiLascia's sample -- Getting Version Info, CFolderTabCtrl Revisited
http://msdn.microsoft.com/msdnmag/issues/02/10/CQA/
I got two vertical and two horizon scroll bars.
The Scroll Bar with Excel style Button was disable.
how can I get scroll bar work?
Could you give me some ideas?
Best regards,
|
|
|
|
|
If you don't need zooming (which I unfortunately suppose you do), you could get around this by making sure that the virtual size always equals the physical size. In those cases, the diagram editor will not display a scrollbar.
Other than that, you'll have to hack the diagram editor and merge the code for the two projects - not having checked the source code ot the CFolderTabCtrl , I have no idea on the amount of work this will involve. All the editor scroll handing is located in the main editor class.
Please note that there is documentation of the class at http://www.codeproject.com/miscctrl/diagrameditor.asp[^]
|
|
|
|
|
Thank you very much, Sir.
What would happen if I change CMyView derived from CView to CScrollView?
My application is bacsically design like:
In my CMainframe, I have a
CFolderTabCtrl m_FolderCtrl;
The CFolderTabCtrl have the vertical and horizonal Scrollbars.
The m_FolderCtrl is the parent of CMyView and CMyView is the parent of CDiagramEditor.
From my understanding, CDiagramEditor handles all CScrollbar inforemation.
Could you tell me a direction? that would be easier for me.
I made some changes in the CDiagramEditor:SetupScrollbar()
I changed like: GetParent()->Getparent()->SetScrollInfo(...); But It did not work.
the problem is: I used "GetParent()->Getparent()->GetScrollInfo(...)" the "si" has no valid information.
Best regards,
-- modified at 17:43 Sunday 11th February, 2007
|
|
|
|
|
Making the view derive from CScrollView will not help, you could most likely expect to see three sets of scrollbars instead.
I suspect there is only one practical way to solve this - to modify CDiagramEditor so that it will not display any scrollbars at all, and then scroll the contents based on the CFolderTabCtrl scrollbars. For this, you will want to check the current scrolling code and either pass on the scroll-messages directly from the CFolderTabCtrl or call the CDiagramEditor scroll-functions from the main frame. This will be tricky, as CDiagramEditor works with a virtual screen, while CFolderTabCtrl most likely is based on a physical window larger than the CFolderTabCtrl -window.
|
|
|
|
|
Hi there
Just downloaded the latest version of the source (Thanks again Johan for all that hard work) and got an error
reportgenerator\borderline.h(23): error C4716: 'CBorderLine::operator=' : must return a value
What should this return now?
class CBorderLine
{
public:
// Construction/destruction
CBorderLine();
virtual ~CBorderLine();
operator=( const CBorderLine& line ){
m_visible = line.m_visible;
m_style = line.m_style;
m_color = line.m_color;
m_thickness = line.m_thickness;
};
|
|
|
|
|
But Alex , you have already been answered in the thread rorVS 2005 problem! This is the same problem, no implicit returns anymore.
|
|
|
|
|