|
I think I found the problem in CReportEntityPicture::SetFilename(), in the following statement:
m_bitmap = ( HBITMAP ) ::LoadImage( NULL, m_filename, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE | LR_DEFAULTCOLOR );
I replaced the flag LR_DEFAULTCOLOR in parameter 6 above with LR_CREATEDIBSECTION to the following and it works!
m_bitmap = ( HBITMAP ) ::LoadImage( NULL, m_filename, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE | LR_CREATEDIBSECTION );
Thanks for this great article!
|
|
|
|
|
And I who even made a report with a bitmap and tested it... Thanks for the help! The correction will go into the codebase at the soonest possible time.
|
|
|
|
|
I'd just to say you that your codes are simply genious.
I noticed that in spite of my many years of experience, I'm still a beginner compared to you.
Thank'a a lot for sharing a such of work.
Rabiby
|
|
|
|
|
Let's not create an inflation in words I'm certainly no genius, and I also have a few years of experience. But big thanks for the kind words!
|
|
|
|
|
My god, I noticed this project yesterday, the functionality style is familiar, especially the handling of text file, like your UML Editor etc, but I did not notice that author's name. I revisit this project today and notice that it IS your project, wow, you genius crazy! You REALLY type FAST
Excellent coding!
btw:
1.any idea of data-binding? I mean it can automatically accept a data source and bind data to corresponding fields, I know it is hard
2.Editor binary file download?
Regards,
unruledboy@hotmail.com
|
|
|
|
|
Yes, it's me again By the end of 2005, I will have written half of the articles on CodeProject. Then it will be a fulltime job just to maintain the code
Unruled Boy wrote:
1.any idea of data-binding?
I want to avoid tying the code to any specific type of data source, but I'll try to make the data feed more flexible. Perhaps also example code on how to pulg this together with a database - but my last efforts in this direction using MFC was with CRecordSet s...
Unruled Boy wrote:
2.Editor binary file download?
Elaborate on this, you just lost me
|
|
|
|
|
Hey, WOW is an obvious response to the effort & result you pulled here!!!
still, i think you made a bad choice of creating a propietary format of template files. had you choosen xml file, the sky was the limit.
this is a much needed package, and conforming with common protocols would have promoted this package a great deal, for instance I think that it would have been a lot easier to create a better template designer (A.K.A ReportCreator ) in C# - Winforms and save it to xml.
nevertheless,
striking and much needed!
great job, really.
DaberElay.
|
|
|
|
|
Thanks for the feedback!
As for the format, this is the same format I've used for the editor, which is derived from my CDiagramEditor (also published here). Having this format is for the simple reason to keep the parsing uncomplicated. Otherwise I would either have to have added an XML-parser to CDiagramEditor , which, while certainly not being rocket-science, was a bit outside the scope of that project, or use someone elses code, which would have defeated the current simple integration into other projects (in addition to difficulties finding other free software with the same lunatic licence I grant for users of mine )
But I think I'll add a "feeder"-function, where the proprietary format can be fed from memory instead of a file, then you can add XML-support to your heart's content!
Remember that you also have access to the full commented source code, nothing stops you from ripping my code, rewrite what you like and create a new article. Or sell it. Or whatever
|
|
|
|
|
Hey Johan! Ya know, it's really not fair. The stuff you post on CodeProject is better than the stuff I do for a living. Sort of makes me want to just open up a small all-night store
Sorry, I only gave you a five. I don't need this (at least not yet), but it's nice piece of work.
Sheesh! I guess I'll go check out the classifieds for a nice vacant shop somewhere.
All the best!
|
|
|
|
|
You should see the stuff *I* do for a living Thanks for the feedback!
|
|
|
|
|
Somebody has just dialed 911 for me
I have just been exposed to a five-star knock-you-out article.
Don't know much < I, don't care much > I, while I am here ... just be happy
|
|
|
|
|
That was never my intention, I'll have to learn to hold back for the next article
|
|
|
|
|
Thanks for your great job. It's wonderfull. I have been looking for something similar for a while. I think it's going to help me in a project for a database engined report document. I thin I'll make you some questions about your work. Anyway, thanks for all.
|
|
|
|
|
Thanks for the nice feedback! And you are of course welcome with any questions you might have.
|
|
|
|
|
I see you have quite the same age and backgroud as I have, C64 seems to be a good starting point for many of us
I've been using Crystal Reports for quite a long time now (since 1994) in different VB or .NET projects. I can't say I'm tired if this product but there should always be place for this kind of free lunches! What keep us using CR is the easy design and the strong support for different export formats (PDF, RTF Excel...). The bad thing with CR is at the same time a strength too, it's a very big product with many versions/licenses
As you know MS launched their report generator in SQL2000 I think, and now it's called "report sevices" or something in SQL2005. Have you looked something into that? What RG:s have you been using?
Another question, can I build what I call dynamic reports with your RG? I want to design an easy report template, load it in runtime, add data fields, groupings, formatting rules and so on at runtime? If I want to to this properly with CR I have to buy their expensive enterprise version, which use is intended of course to the enterprise company.
PS. Kul att se att det skrivs bra artiklar av svenskar här.
Greetings
/Håkan N.
------------------------------------------------
- Bachelor in systems analysis 1991
- Systems developer, C#, Java, C, VB3-6
- DBA, database design, SQL, admin
------------------------------------------------
|
|
|
|
|
Håkan Nilsson wrote:
I see you have quite the same age and backgroud as I have, C64 seems to be a good starting point for many of us
I would - in addition to the old trustworthy C64 - like to mention Ramones and Kant as a good base for software development
Håkan Nilsson wrote:
Have you looked something into that? What RG:s have you been using?
I've not used any RG:s, to be honest. Either, I've worked with projects not needing them, or projects having proprietary solutions.
Håkan Nilsson wrote:
Another question, can I build what I call dynamic reports with your RG?
As the source code is included - of course But for the time being, you would have to do it by deriving a class from CReportGenerator , adding members to create new objects. You might want to look how the objects are created now, and feed string representations of the dynamic objects into the generator in a similar fashion, for example.
But this is of course much too cumbersome, the idea to be able to add fields during runtime is a good one, and I'll most certainly add it for the next update of the article (or first in this case).
Håkan Nilsson wrote:
PS. Kul att se att det skrivs bra artiklar av svenskar här.
Vi får ju visa anglosaxarna var skåpet skall stå
|
|
|
|
|
When designing generators in common there is always a good point to isolate internal functionality (b.e. "create new data column on report") so it can be used in a programming model exposed external later on when the product has been out there for a while. I'm sure you agree with me, but sometimes this is easier said than done.
I'm really impressed by your work and that you gone into a field where most people got a lot of opinions I guess. Maybee you can develop it further and release it as a poor man's RG alternative to CR and MS$ and then in a couple of years everyone use it for simple reporting and throws out other expensive RG:s I haven't seen the prising yet for MS reporting services, but somehow I'm sure they want to get paid.
I don't use my spare time anymore to develop code (at least not now). I take care of my family and myself instead. I'm sure you find some people interested in helping you with dev. or testing this product.
Bra att du orkar hålla ångan upp, jag har tröttnat lite, trots att det är en massa ny teknik. Vore kul att bygga något som står stabilt i mer än fem år eller så.
/Håkan
------------------------------------------------
- Bachelor in systems analysis 1991
- Systems developer, C#, Java, C, VB3-6
- DBA, database design, SQL, admin
------------------------------------------------
|
|
|
|
|
Håkan Nilsson wrote:
When designing generators in common...
I agree, but for this project, the amount of code is not yet big enough to create a model. One of the great things developing stuff like this is that you can let it grow organically. If the structure is not working any longer, fine, redo it. This is not possible with a commercial project (at least none I've been involved with).
Håkan Nilsson wrote:
don't use my spare time anymore to develop code...
For me, it's both a hobby and a job. Have to cut down on sleep, though
Håkan Nilsson wrote:
Bra att du orkar hålla ångan upp
Jag tycker fanimej fortfarande att det är roligt. Inte minst när man kan designa ett eget projekt såhär.
|
|
|
|
|
Thank you for your report generator!
I have been searching for a report generator like this for years.
Excellent work!
|
|
|
|
|
Thanks for the kind words. But Denis_B, the years spent searching might have been better spent writing stuff like this
|
|
|
|
|
You've outdone yourself this time. I have to take a closer look at it; we've been searching for a better report generator than Centura Report Builder for years but haven't found one. It gives us dynamic capabilities that Crystal Reports (unbelievably) doesn't have. This may be exactly what we need: a solid, hackable report generator.
Excellent!
|
|
|
|
|
You make me embarrased, I don't find this project especially significant - the vector editor is far more complicated. But only a very ungrateful man would not be happy with the good feedback
|
|
|
|
|
Hi!
I didn't search through the whole code, but concerning CReportGenetaror, I don't see the need for RTTI. You already use a way to get rid of it:
Look at:
<br />
int CReportGenerator::GetFieldColumns( int field ) const<br />
{<br />
...<br />
if( GetFieldType( field ) == FIELD_TYPE_GRID )<br />
{<br />
CDrawGrid* obj = static_cast< CDrawGrid* >( GetData().GetAt( field ) );<br />
if( obj )<br />
result = obj->GetColumns();<br />
}<br />
<br />
...<br />
}<br />
So why don't you use the same procedure e.g. in
<br />
BOOL CReportGenerator::Add( const CString & field, const CStringArray & data )<br />
{<br />
...<br />
<br />
CDrawGrid* obj = dynamic_cast< CDrawGrid* >( m_fields.Get( field ) );<br />
if( obj )<br />
{<br />
obj->AddData( data );<br />
result = TRUE;<br />
}<br />
<br />
...<br />
}<br />
Just a thought
Regards, Ralph
|
|
|
|
|
This is indeed true, and the same goes for the ReportEditor - but let's just keep it anyway! With the RTTI we have a bit more options than just checking a flag (if I want to add more levels to the hierarchy) - so if anything should be modified, it would rather be the other way around
|
|
|
|
|
Any chance you wanna play with new lang..
:->
Sk8tZ
|
|
|
|
|