|
Your wish is my command
This is actually already implemented, just call AddTemplate with the resource id. The resource must be set as having the custom type RG_REPORT .
|
|
|
|
|
I think the following features can be added:
1.Group and Ungroup.
2.Alignment without the reference shape.
3.Ability to set tranparency in object fill properties.
4.Drag and drop the database list item from the listbox to the canvas,if there is a XD++ like toolbox:
XD++ MFC Library (can be found with: http://www.ucancode.net) will be very useful.
I will starting work now,but if you can include a class diagram of your project that will be very useful.
Great work!!
Thanks!
|
|
|
|
|
Thanks for the feedback!
Your points:
cindyonlyone wrote:
1.Group and Ungroup.
This is already implemented in the underlying framework. I will add UI for it the next update round, if you are in a hurry, you might want to download my UML-editor here at CodeProject, where grouping is already implemented. In short, you'll have to add Group/Ungoup menu alternatives, and call the singular appropriate functions in the editor.
cindyonlyone wrote:
2.Alignment without the reference shape.
Here I'm slightly lost. What to align with if not another object?
cindyonlyone wrote:
3.Ability to set tranparency in object fill properties.
Transparency is accomplished by unchecking the Fill checkbox in the relevant objects.
cindyonlyone wrote:
4.Drag and drop the database list item from the listbox to the canvas,if there is a XD++ like toolbox:
XD++ MFC Library (can be found with: http://www.ucancode.net) will be very useful.
Adapting to external code is left as an exercise for the reader
cindyonlyone wrote:
if you can include a class diagram of your projec
I hear and obey! Check the documentation downloads. You'll find UML-diagrams
in each doc. I note, however, that the index.html file for the report editor is empty - nevertheless, re_uml.html contains the UML-diagram, and you can access class information through Classes/index.html.
You might also, if you are interested, want to download the docs for CDiagramEditor , from http://www.codeproject.com/miscctrl/diagrameditor.asp[^]
|
|
|
|
|
Your response is very clear!
Thanks And Best Regards
|
|
|
|
|
First at all TNX for the grate work.
I change the line per inch in the grid from int to float that give me better control on row high, its very useful for label print.
How can I send u my change?
|
|
|
|
|
Thanks for the kind words!
galroy wrote:
How can I send u my change?
There is a small field towards the bottom of this text, with the text [e-mail]. this is my proper e-mail address. Otherwise, my e-mail is johan.rosengren@telia.com
|
|
|
|
|
Hi Johan!
Great work thank you a lot !
If possiblem, for the future, take in consideration a MULTI-BAND design in the same worksheet
For example
- Header band
- Details band
- Footer band
Thank you
G.Luca
|
|
|
|
|
There's already partial support for this. All fields will be repeated, so that it is possible to have - for all practical reasons - a header and a footer. If the report contains a grid, it will work much like a body.
But it would indeed be nice to have some kind of "pseudogrid", with normal fields that is repeated as many times as it can fit on one page. It is, however, a little bit difficult to envision a simple and general way of filling it with data. Perhaps CStringArrays for fields... hm.
More specific wishes welcome!!!
|
|
|
|
|
Thanks for your great job. I have two questions need your help。
First,as you said this project only suppport BMP files ,i want to support more type files,so i add CxImage to this project,but it looks can't work,the image can't be shown.why is it?how i can support more files?
second, i want to paste the image to the report from clipborad,it is possible? how i can do it ?
I am a chinese student ,ma english is poor,so i can only experss my idea,No words can express my heart,
Only say,
thank you!
|
|
|
|
|
Thanks for the feedback!
As for CxImage , I have no idea You would need to add CxImage , of course, and then modify the CDrawPicture class. There, you will have to modify SetFilename (at least) to use CxImage instead of the API-call ::LoadImage . What you want to do is to finally het a HDIB and set the m_bitmap -member. If that is possible, I don't know enough about CxImage .
There is currently no real clipboard-support, this would mean giving true clipboard-support to CDiagramEditor , which is not a small matter to do. More than that, there would have to be a callback-mechanism translating the external stuff pasted, all in all a major addition.
|
|
|
|
|
Thank you very much! I will try to do it. if has any question ,I will trouble you again
Thank you again!
|
|
|
|
|
|
Thank you for your great job.as you said this project only support BMP files,so i try to add CxImage into this project。but it can‘t to work,the image is not shown. so i need you help,how i can change it to support more type image files.
T hank you!
|
|
|
|
|
Hi Johan,
excellent work.
the .rpt extension your using is the same as the one crystal reports uses. if CRW is installed on the system, your reports get associated with CRW, and CRW attempts to open them.
thanks
Peter
|
|
|
|
|
Crystals will just have to change, then
Joking aside, you might have noticed that I'm not registering any extension myself, and the report generator have no preference regarding the extension, so you can just save the templates with whatever extension you like.
If anyone has a good suggestion for a non-used extension, I'm all ears!
|
|
|
|
|
Hi,
You do a great work with the report generator but I have some suggestions :
- It would be great if you could create a cell oriented grid, that is a grid with labels as cells to configure the layout of each cell.
- It would be great too if you could make the grid object "dynamic", that is with a non fixed height so the grid can be print on several pages and objects below the grid would be moved to the next page.
Sorry for my english, I am french. I hope you understood me.
Thanks.
|
|
|
|
|
Your English is just fine, which you can't say about my French OTOH, your Swedish is probably rotten
Cell-oriented grid - I'm actually moving in that direction just now, with the addition of the cell-based markers [%bold%] and [%italic%]. But I have a problem with this, and dynamic row heights as well, that is the calculation of page sizes. This will of course be far more complicated if each row takes different height. Sooner or later, I will have to add it, though, as it would be needed for - for example - such mundane tasks as creating a details cell for an invoice.
So, both your suggestions are noted, and will be implemented when time allows.
|
|
|
|
|
Thanks for the nice code... Using the "Report Creator" program, when I double click on one of the columns in the properties box of a grid object and select OK without doing anything the column width changes.
Please note that I'm using the centimeter metic system.
Please advise
~~~~~~~~~~~~~~~
CDRom
|
|
|
|
|
As the coordinates are internally stored in inches, this is - to some degree - unavoidable. That, is you display the grid, the internal coordinates will be converted to centimeters. When you press ok, all information will be gathered, and converted back to inches. If you now open the dialog again, they will have changed.
If they do this each time, that is, they don't fix on a final value, then this is an error - I'll look into it. Eventually, I might build in a mechanism that check each field - if it is modified or not - and only updates the changed ones.
|
|
|
|
|
Hi
thanks for your program, and i find some bugs.
1) In ReportBoxProperties.cpp,ReportEllipseProperties.cpp,etc. SetValue()method maybe lost this line
m_borderThickness = obj->GetBorderThickness();
2) When i use reportgeneratordemo.exe to preview my report, i find drawbox and drawellipse will use default pen and brush, i means that CPen and CBrush will take no effect even if i set the box width too thick. Then i try to solve it, in CDrawBox::Draw(),i changed like this:
{
const CBorderLine* line = GetBorder();
CPen pen;
CPen* pOldPen = NULL;
CBrush brush;
CBrush* pOldBrush = NULL;
if( line->GetVisible() )
{
int thickness = CUnitConversion::InchesToPixels( line->GetThickness() );
pen.CreatePen( line->GetStyle(),
thickness,
line->GetColor() );
pOldPen = dc->SelectObject(&pen);
}
else
dc->SelectStockObject( NULL_PEN );
if( GetFill() )
{
brush.CreateSolidBrush( GetFillColor() );
pOldBrush = dc->SelectObject( &brush );
}
else
dc->SelectStockObject( NULL_BRUSH );
CDoubleRect rect = GetPosition();
CUnitConversion::InchesToPixels( rect );
CRect r( ( int ) rect.left, ( int ) rect.top, ( int ) rect.right, ( int ) rect.bottom );
CUnitConversion::AdjustPixelsToPaper( dc, r );
dc->Rectangle( r );
if( pOldPen ) dc->SelectObject(pOldPen);
if( pOldBrush ) dc->SelectObject(pOldBrush);
}
Is it right? anywise i'm very thanks
|
|
|
|
|
Thanks for your feedback!
I'll go through the codebase of all articles during easter, and I'll look into this as well. I assume there will be an update of the article - or rather code - quite soon.
|
|
|
|
|
Hy!
Your article is brilliant!
Also I am not a good MFC programmer like you, so I have a small easy question about using your code.
I made extensions for AutoCAD. This dll run within AutoCAD, and I want to show PrintPreview, from a dialog button.
I mean, Doc/View print/preview works with the AutoCAD drawing, but in my program you can also print/preview some report about drwaing.
What should I insert in my handler (for example) OnReport() to show the report preview to the user, after it, if he/she want, can print out.
My question in short form:
How can I use CReportGenerator, to preview a report without using Doc/View?
Waiting for your answer,
Zoltan
|
|
|
|
|
Thanks for the kind words!
To create a print preview from scratch, the way you would need to do, is not trivial. Basically, you would have to create a CDC mimicking the CDC of a printer. This includes getting dimensions from the CDC and setting the coordinate system to emulate that of the printer. You would have to do this in a specially created CWnd .
A little help can be found in the report creator, in which you can zoom the window, this is for all practical purposes the same as a print preview. I use a zoom factor with all drawing, however, and you would best run in an anisotropic mapping mode. You'll want to check the following CDC -members:
SetMapMode (to set up the mapping between logical and physical coordinates)
SetWindowExtents (to set up the mapping between logical and physical coordinates)
SetViewportExtents (to set up the mapping between logical and physical coordinates)
GetDeviceCaps (to get the resolution and number of printable pixels for the paper)
(you'll have to excuse any spelling- or other errors in the names, I'm writing from memory ) I realize that I'm not making much sense here, but this is really another fullblown article...
You can also take a look at the MFC print preview source code, and there might be other articles of interest here on CodeProject.
|
|
|
|
|
Hy,
Thanks for your help.
I found here an article:
Printing without the Document/View framework
By Chris Maunder
which made, what I need, Print/Preview without MFC Doc/View framework.
THX again,
Zoltan
|
|
|
|
|
Thank you so much for posting this wonderful article. Definitely deserve 5 stars. I'm playing with this Report Generator and want to know how to print to some non-standard size continuous paper like mailing and shipping labels and get the page length (when ejected) correct. Would you mind showing us how?
|
|
|
|
|