 |
|
 |
thanks for your excellent code!
I want to know how to insert a control to it such as mschart?
|
|
|
|
 |
|
 |
Not sure if anyone is still monitoring this application thread, but has anyone tried importing the code into a VS 2010 Solution/Project? If anyone has successfully accomplished this could you post the steps to your success? Attempting to fix any errors generated during compilation is leaving me with about 1500 errors.
Thanks
|
|
|
|
 |
|
|
 |
|
 |
Thank you for your great classes.
I'v used your code several times, and there is a memory leakage when printing images.
Image from LoadImage() shoud be released by DeleteObject().
CDrawPicture::SetFilename(CString value)
{
.
.
.
if(m_filename.GetLength())
{
.
.
if(bmp)
{
m_bitmap= DDBToDIB(bmp);
::DeleteObject(bmp)
}
}
}
|
|
|
|
 |
|
|
 |
|
 |
Can the reports be displayed in a view where they can be cut and pasted into MS Word or some other application? Or, like the demo, can they only be viewed and printed?
Ann Nockerts, C++ developer
|
|
|
|
 |
|
 |
How can I fill report_fields with data during printing?
|
|
|
|
 |
|
 |
Create a merge engine.
1. Parse and map the template data fields by name and data record column.
Example: Data record.name is column 2. Template NameField would be mapped to 2.
2. For each data record iterate the template(s) using the map to find the matching data field in the template(s).
3. Remember there are 3 basic "types" you must switch between. Field, Picture and Grid.
4. Merge the data into the data fields according to the map. All fields of the same name are replaced with the same data as in a simple mail merge.
Example adding data where "strValue" is the value from the record:
((CDrawPicture*)pObj)->AddData(strValue);
or
((CDrawField*)pObj)->AddData(strValue);
|
|
|
|
 |
|
 |
Greater work,
TO CONVERT MDI FOR SDI?
TKS.
|
|
|
|
 |
|
 |
GREAT WORK, TKS...
|
|
|
|
 |
|
 |
Thanks Johan,
how can I suppress the CPrintDialog?
|
|
|
|
 |
|
 |
Hi Johan,
I like this report generator, I have a situation in which I am using an ATL COM Project which is an MS Office Addin. I want to implement this thing in my project mainly for previewing the reports, so can you guide me, the benifits and hazards of implementing this thing in an ATL COM Office Addin? Will it make my application extremely heavy??
Thanks in Advance
Maverick
|
|
|
|
 |
|
 |
finally, been looking for something like this for a while
thanks !
|
|
|
|
 |
|
|
 |
|
 |
I would like to create a template using the report creator application. I want the user to be able to generate templates that is more than one page. Is there a way to add a page break to the template so that the generator knows that it is a page break and go to the next page while displaying it in the preview screen. Thanks for all the help. SS.
|
|
|
|
 |
|
 |
Hello and Thanks for the code. Also thanks for the License - TISATAAFL Is that pronounced TIZ AH TAF FULL ?
|
|
|
|
 |
|
 |
Hi Johan,
Thanks for your codes, it is very useful!
I am trying to add some Header and footer into the report. (which can be shown on each page of the report).
Do you have any idea how this can be achieved?
It seems the Muli-template can only add different section into the report (which are shown on different pages).
Thanks & Regards,
Kevin
|
|
|
|
 |
|
 |
hello Johan Rosengren
first , thank you supply so nice source
I have use your report three days ,i found when i print the report with bmp on it ,there always have memory leak and only if the report with bmp on it will occur memory leak
of course nobody always to print his report ,but i think if there really have a little bug ,you should have method to amend it
modified on Friday, September 25, 2009 10:37 AM
|
|
|
|
 |
|
 |
How can I change the width of specific grid columns at runtime?
SetWidth() is not an option with GetObject().
Thanks.
modified on Monday, August 3, 2009 8:41 AM
|
|
|
|
 |
|
 |
Hello!
Once again my thanks for this wonderful contribution. I wanted to let you know about a couple things I uncovered.
I started using grids in some templates and noticed a problem with column sizes. The columns were consistently smaller widths in the Generator compared to the Editor. I kludged around the problem by replacing the CUnitConversion::InchesToPixels calls in the "void CDrawGrid::Draw( int page, CDC* dc )" column calculations with:
CUnitConversion::LineToPixels
{
double pixelsPerInch = static_cast(CUnitConversion::s_resolution) *
(inches * 1.25);
return static_cast(pixelsPerInch);
}
The 1.25 offset made them fit the border rectangle perfectly, but I don't know why my kludge works or why InchesToPixel wasn't sufficient. It seems my results are not totally correct either since I can make a box in the Editor the same width as the column, but box and column will be different widths in the Generator.
The second problem with sizing was with the page itself. I set a page to 8.5 x 11 inches and set a .5 inch border on each side. The page then prints/previews from the Editor with an extra .5 inches on the right and bottom.
I traced the problem to "void CReportCreatorView::OnDraw(CDC* pDC)" and made another kludge as follows:
// Print zoom is the difference between screen and printer resolution.
double zoom = pDC->GetDeviceCaps( LOGPIXELSX ) / m_screenResolutionX;
zoom += .12;
Again, I don't know why adding .12 to the zoom factor was necessary or exactly how it fixed the problem.
If anyone knows why this is or has a good fix for the problem(s) please let me know. Thank you in advance.
|
|
|
|
 |
|
 |
Wouldn't you know I discovered and fixed the column width bug right after I sent in my question!
The problem is that in CColumn the width is set to type int, where it should be type double. If you have columns that are fractional they would be truncated to int!
To fix, simply change all CColumn "width" properties and methods to type double. All the column width issues disappear.
|
|
|
|
 |
|
 |
ReportEditor source looks have lots of things.
I'll appreciate again if you offer some usage to use it in MFC apps.
Could you upload a ReportEditor demo project?
|
|
|
|
 |
|
|
 |
|
 |
I need to use one field more than once. I have looked at CReportGenerator::Add (as you sugested on 5 Jan '07 to yokosuna) and have tried to modify it, unfortunately without any luck.
How do I get the name of the objects that I iterate over? I am thinking of something like this:
BOOL CReportGenerator::Add( const CString & field, const CString & data )
{
SetErrorMessage( _T( "" ) );
BOOL result = FALSE;
CDrawField* obj = dynamic_cast< CDrawField* >( GetObject( field ) );
if (!obj)
return FALSE;
int iMax = GetData().GetSize();
for(int i=0; i<imax;>
{
if (obj->GetName() == ?????->GetName()) {
obj->AddData( data );
result = TRUE;
}
}
return result;
}
However, I am not sure that this will solve the problem. For testing, I added a second obj->AddData(data); right after the first one but the second occurence of the field was still not printed.
I believe it is important that the same field can be used more than once. Any help would be very much appreciated.
Like others have already said, thank you very much for this great code.
modified on Thursday, February 19, 2009 2:28 AM
|
|
|
|
 |
|
 |
I'm not sure why you want to use the same field twice? As the field would have the same properties, it would just print over itself, and being the same instance, any delete would wreak havoc with the other instance. You might want to copy the field to a new one instead - which still would be of little use if the attributes of the two fields would be identical.
|
|
|
|
 |