15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


Crystal Report with MFC

Marco Valerio -- valeriom@smfds2.milano.italtel.it
Thursday, August 01, 1996

Environment: Visual C++ 4.1, Win95

I would like to use Crystal Report to print and to do the Print 
Preview of some tables of my program.
These tables are not database tables, they are just some data wich I 
elaborate in my program and are visualized in the view using the 
format of a table.
These tables are not associated with any file.
Is It possible to use Crystal Report without having to associate it 
with a file ?

Thank you
---------------------------------------
Marco Valerio 

valeriom@smfds2.milano.italtel.it
---------------------------------------



Thomas Drolshagen -- drolshagen@deos.ch
Monday, August 05, 1996

[Mini-digest: 3 responses]

Hi Marco
Yes, you can use Crystal Reports without having a data file.
Place a formula into your .RPT File and set it's content from the
.CPP file using the SetFormula function.

HTH
Thomas Drolshagen

>----------
>From: 	Marco Valerio[SMTP:valeriom@smfds2.milano.italtel.it]
>Sent: 	Donnerstag, 1. August 1996 08:45
>To: 	mfc-l@netcom.com
>Subject: 	Crystal Report with MFC
>
>Environment: Visual C++ 4.1, Win95
>
>I would like to use Crystal Report to print and to do the Print 
>Preview of some tables of my program.
>These tables are not database tables, they are just some data wich I 
>elaborate in my program and are visualized in the view using the 
>format of a table.
>These tables are not associated with any file.
>Is It possible to use Crystal Report without having to associate it 
>with a file ?
>
>Thank you
>---------------------------------------
>Marco Valerio 
>
>valeriom@smfds2.milano.italtel.it
>---------------------------------------
>
-----From: Yannick Skelling 

I've tried this and Crustal told me it is impossible to not associate
with a file. There are two ways ( an surely more ?) of doing what you
want to do :
1- Use DAO and a database. Send everything to your DB and creata the
report. This one is the easiest, but adds a lot of "junk" to the files
to distribute with your application !
2- Use a Text file as a database ( ODBC). Put a dummy table with a dummy
record in it. Pass the rest of the information with formulas.
With the classes given with crystal, you can use  to get the name of the
formula, you can use 

Hope this helps !

Here is some code...

	CRPEngine m_ReportEngine;
	CRPEJob * aJob;
	
	CRPETableLocation * aLocation;
	aLocation = new CRPETableLocation("..\\reports\\Reports.mdb");

	aJob = m_ReportEngine.OpenJob("..\\reports\\resume.rpt");

	aJob->SetNthTableLocation(0, aLocation);

	CString str("What you put in your report");
	
	aJob->SetFormula("name_of_formula","ToText (" + str + ",3)");

	aJob->OutputToWindow("Moistaware QuickReport",0,0,500,500,
WS_VISIBLE|WS_CAPTION| WS_POPUPWINDOW ,NULL);  

	aJob->Start();

 

> Thank you
> ---------------------------------------
> Marco Valerio
> 
> valeriom@smfds2.milano.italtel.it
> ---------------------------------------

-- 
**********************************************************
* Yannick Skelling                                   \   *
* Analyst Programmer                                o_\  *
* Thermetrics Diagnosys Ltd.                        \__\ *
* diagnosys@vir.com                                  |  \*
*                                                        *
*          "Be a virus, see the world."  -Gary Larson    *
**********************************************************
-----From: "Jeffrey T. Blake" 

I'm working with a similar scenario.  I called the folks at Crystal
about this and the person that I spoke to said that I need to create
a DBF file in order for report file (RPT) to work.  However, this
person was not sure if there was a way to create a dynamic report.

I'm working on this now and I'll let you know if I find anything
encouraging.

Jeff Blake
jtblake@inforamp.net
http://www.inforamp.net/~jtblake
Regards,
Jeff Blake, P. Eng.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Blake & Associates (Engineering software for buildings)
jtblake@inforamp.net
http://www.inforamp.net/~jtblake
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~




Roger Longren -- rlongren@execpc.com
Monday, August 26, 1996

If you print a report directly from program code using the Crystal
SetFormula() function, how do you handle multiple "records" and multiple
pages?  It seems that this would lend itself to only a single page
containing a single record.

Roger Longren

************************************************************

Thomas Drolshagen wrote:
> 
> [Mini-digest: 3 responses]
> 
> Hi Marco
> Yes, you can use Crystal Reports without having a data file.
> Place a formula into your .RPT File and set it's content from the
> .CPP file using the SetFormula function.
> 
> HTH
> Thomas Drolshagen
> 
> >----------
> >From:  Marco Valerio[SMTP:valeriom@smfds2.milano.italtel.it]
> >Sent:  Donnerstag, 1. August 1996 08:45
> >To:    mfc-l@netcom.com
> >Subject:       Crystal Report with MFC
> >
> >Environment: Visual C++ 4.1, Win95
> >
> >I would like to use Crystal Report to print and to do the Print
> >Preview of some tables of my program.
> >These tables are not database tables, they are just some data wich I
> >elaborate in my program and are visualized in the view using the
> >format of a table.
> >These tables are not associated with any file.
> >Is It possible to use Crystal Report without having to associate it
> >with a file ?
> >
> >Thank you
> >---------------------------------------
> >Marco Valerio
> >
> >valeriom@smfds2.milano.italtel.it
> >---------------------------------------
> >
> -----From: Yannick Skelling 
> 
> I've tried this and Crustal told me it is impossible to not associate
> with a file. There are two ways ( an surely more ?) of doing what you
> want to do :
> 1- Use DAO and a database. Send everything to your DB and creata the
> report. This one is the easiest, but adds a lot of "junk" to the files
> to distribute with your application !
> 2- Use a Text file as a database ( ODBC). Put a dummy table with a dummy
> record in it. Pass the rest of the information with formulas.
> With the classes given with crystal, you can use  to get the name of the
> formula, you can use
> 
> Hope this helps !
> 
> Here is some code...
> 
>         CRPEngine m_ReportEngine;
>         CRPEJob * aJob;
> 
>         CRPETableLocation * aLocation;
>         aLocation = new CRPETableLocation("..\\reports\\Reports.mdb");
> 
>         aJob = m_ReportEngine.OpenJob("..\\reports\\resume.rpt");
> 
>         aJob->SetNthTableLocation(0, aLocation);
> 
>         CString str("What you put in your report");
> 
>         aJob->SetFormula("name_of_formula","ToText (" + str + ",3)");
> 
>         aJob->OutputToWindow("Moistaware QuickReport",0,0,500,500,
> WS_VISIBLE|WS_CAPTION| WS_POPUPWINDOW ,NULL);
> 
>         aJob->Start();
> 
> 
> 
> > Thank you
> > ---------------------------------------
> > Marco Valerio
> >
> > valeriom@smfds2.milano.italtel.it
> > ---------------------------------------
> 
> --
> **********************************************************
> * Yannick Skelling                                   \   *
> * Analyst Programmer                                o_\  *
> * Thermetrics Diagnosys Ltd.                        \__\ *
> * diagnosys@vir.com                                  |  \*
> *                                                        *
> *          "Be a virus, see the world."  -Gary Larson    *
> **********************************************************
> -----From: "Jeffrey T. Blake" 
> 
> I'm working with a similar scenario.  I called the folks at Crystal
> about this and the person that I spoke to said that I need to create
> a DBF file in order for report file (RPT) to work.  However, this
> person was not sure if there was a way to create a dynamic report.
> 
> I'm working on this now and I'll let you know if I find anything
> encouraging.
> 
> Jeff Blake
> jtblake@inforamp.net
> http://www.inforamp.net/~jtblake
> Regards,
> Jeff Blake, P. Eng.
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Blake & Associates (Engineering software for buildings)
> jtblake@inforamp.net
> http://www.inforamp.net/~jtblake
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~




Thomas Drolshagen -- drolshagen@deos.ch
Wednesday, August 28, 1996

Yes, I was using this feature only for printing one "record" to one
page.
Do YOU need this multi-record multi-page printing ?

>----------
>From: 	Roger Longren[SMTP:rlongren@execpc.com]
>Sent: 	Montag, 26. August 1996 17:45
>To: 	mfc-l@netcom.com
>Subject: 	Re: Crystal Report with MFC
>
>If you print a report directly from program code using the Crystal
>SetFormula() function, how do you handle multiple "records" and
>multiple
>pages?  It seems that this would lend itself to only a single page
>containing a single record.
>
>Roger Longren
>
>************************************************************
>
>Thomas Drolshagen wrote:
>> 
>> [Mini-digest: 3 responses]
>> 
>> Hi Marco
>> Yes, you can use Crystal Reports without having a data file.
>> Place a formula into your .RPT File and set it's content from the
>> .CPP file using the SetFormula function.
>> 
>> HTH
>> Thomas Drolshagen
>> 
>> >----------
>> >From:  Marco Valerio[SMTP:valeriom@smfds2.milano.italtel.it]
>> >Sent:  Donnerstag, 1. August 1996 08:45
>> >To:    mfc-l@netcom.com
>> >Subject:       Crystal Report with MFC
>> >
>> >Environment: Visual C++ 4.1, Win95
>> >
>> >I would like to use Crystal Report to print and to do the Print
>> >Preview of some tables of my program.
>> >These tables are not database tables, they are just some data wich I
>> >elaborate in my program and are visualized in the view using the
>> >format of a table.
>> >These tables are not associated with any file.
>> >Is It possible to use Crystal Report without having to associate it
>> >with a file ?
>> >
>> >Thank you
>> >---------------------------------------
>> >Marco Valerio
>> >
>> >valeriom@smfds2.milano.italtel.it
>> >---------------------------------------
>> >
>> -----From: Yannick Skelling 
>> 
>> I've tried this and Crustal told me it is impossible to not associate
>> with a file. There are two ways ( an surely more ?) of doing what you
>> want to do :
>> 1- Use DAO and a database. Send everything to your DB and creata the
>> report. This one is the easiest, but adds a lot of "junk" to the files
>> to distribute with your application !
>> 2- Use a Text file as a database ( ODBC). Put a dummy table with a dummy
>> record in it. Pass the rest of the information with formulas.
>> With the classes given with crystal, you can use  to get the name of the
>> formula, you can use
>> 
>> Hope this helps !
>> 
>> Here is some code...
>> 
>>         CRPEngine m_ReportEngine;
>>         CRPEJob * aJob;
>> 
>>         CRPETableLocation * aLocation;
>>         aLocation = new CRPETableLocation("..\\reports\\Reports.mdb");
>> 
>>         aJob = m_ReportEngine.OpenJob("..\\reports\\resume.rpt");
>> 
>>         aJob->SetNthTableLocation(0, aLocation);
>> 
>>         CString str("What you put in your report");
>> 
>>         aJob->SetFormula("name_of_formula","ToText (" + str + ",3)");
>> 
>>         aJob->OutputToWindow("Moistaware QuickReport",0,0,500,500,
>> WS_VISIBLE|WS_CAPTION| WS_POPUPWINDOW ,NULL);
>> 
>>         aJob->Start();
>> 
>> 
>> 
>> > Thank you
>> > ---------------------------------------
>> > Marco Valerio
>> >
>> > valeriom@smfds2.milano.italtel.it
>> > ---------------------------------------
>> 
>> --
>> **********************************************************
>> * Yannick Skelling                                   \   *
>> * Analyst Programmer                                o_\  *
>> * Thermetrics Diagnosys Ltd.                        \__\ *
>> * diagnosys@vir.com                                  |  \*
>> *                                                        *
>> *          "Be a virus, see the world."  -Gary Larson    *
>> **********************************************************
>> -----From: "Jeffrey T. Blake" 
>> 
>> I'm working with a similar scenario.  I called the folks at Crystal
>> about this and the person that I spoke to said that I need to create
>> a DBF file in order for report file (RPT) to work.  However, this
>> person was not sure if there was a way to create a dynamic report.
>> 
>> I'm working on this now and I'll let you know if I find anything
>> encouraging.
>> 
>> Jeff Blake
>> jtblake@inforamp.net
>> http://www.inforamp.net/~jtblake
>> Regards,
>> Jeff Blake, P. Eng.
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> Blake & Associates (Engineering software for buildings)
>> jtblake@inforamp.net
>> http://www.inforamp.net/~jtblake
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>




| Вернуться в корень Архива |