Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to use CrystalReport 2016 from VFP9.0 2

Status
Not open for further replies.

A Beginner

Programmer
Apr 15, 2017
81
IN
I want to invoke reporting in crystal report from vfp9.0.
Can any body help?
 
I agree.
Is there also issue with stretch with overflow there? The 'Can Grow checkbox' is not fixing it in my case.
There some registry setting is required as I found on
Registry setting is a dreadful thing isn't it?
This post is a bit out of track though, please ignore it if it is more than it should be..
 
Regarding that thread setting the CanGrow option and limiting the number of rows to 1 fixes the posters issue of text flowing into further columns, so it causes clipping instead of growing. Setting MaxRows higher would cause multiple rows. But also no growth in the horizontal direction, not let the width grow. No one says the registry settings are necessary.

I don't know Crystal, as said, but take your look around further options. If there is a CanGrow option, there may be a way to define the direction of growth, it is logical the natural growth direction is where you can grow "infinitely", as I already explained in your other post.

This is what I found in another discussion:
So also Crystal does not offer the option of automatic column width growth.

Bye, Olaf.
 
...it causes clipping instead of growing." I had tested this. "Can't it grow in vertical direction only pushing the next row that many lines away as many lines it has grown." was my question.
However, very much thankful to you that you have made searching for me.
 
Are you sure you are not confusing the meaning of horizontal and vertical growth?

In thread184-1777416 you said
A Beginner said:
I want to resize object's width
Dynamically changing the width of a column means horizontal growth.

Vertical growth just means multiline text wrapping on a column having a fixed width and is what VFP reports also offer as standard behavior.

Bye, Olaf.
 
Ok.
"Is there also issue with stretch with overflow there? The 'Can Grow checkbox' is not fixing it in my case."
Seems that '...my case' in my last comment is redirecting you to my previous post that was about making a generalized frx for Askingrid.
That issue was fixed by hacking frx.
Here with '... my case' I meant I was testing Stretch with overflow in case of crystal report and I found that it was either clipping the content or overlapping with next line.
whereas in vfp the next row is pushed to next line.
I couldn't do this with my efforts in crystal report so, I was confirming that is it a bug here?
I am Sorry about my way of communication.
 
Hello.

Maybe I can had some clarification. I’m still using Crystal report 2016 with my VFP 9 applications for reporting VFP or SQL Server data.

The RDC was included with Crystal Report until XI Rel2. After that, Crystal Decision decide to discontinue the RDC ActiveX objects for Crystal.

The route Crystal (and now SAP) is to concentrate on .NET technologies.

I think you can download RDC components (Crystal XI R2 SP6) merge modules from the SAP web site ( and install it on your dev. or client machine.

You must create your report with a legit version of Crystal report, or, if you prefer, get a free version of Visual Studio .NET Express (MS), and a free version of Crystal for .NET (SAP). The .NET version of Crystal has the built in report designer so you can create your report in .NET, save it and include it in the VFP application.

I hope it helps a little.

Thanks

Nro
 
I can't help you with Crystal in that matter. I don't have it and never used it. All I could do is search for forum posts about your issue, but you can do that, too.

From the discussion, which I already found, you could have already learned that you can indeed set a number of lines to grow, 0 for infinite lines and a concrete number for limiting the line breaks. I don't know what else this causes in terms of overflowing into other text or clipping the "cell". All I can conclude from the Crystal Report question I found is, that such things are also not so easy with Crystal.

Bye, Olaf.
 
Thanks Olaf for your painstaking guidance.
It is true that many things are not so easy with Crystal but at the same time it is also true many other features and options are wide open here. So before deciding to purchase, willing to do all sort of r&d on it to the extent possible.
 
Welcome NRO, Your sudden appearance with hand-on experience on the things is delightful.
As of now We only have-
1. Crystal Report 2016 (Trial version) and
2. VFP9.0
Please provide us step by step guidance.
* What all things are required If we want to generate the report from vfp itself?
* How to do reporting from crystal report utilizing the cursors and other data sources of vfp?
* How to include CR's report in Vfp applications.
Thank you

 
I can answer some stuff from the perspective of the VFP expert:
You can't share cursors with any DLL or OCX, these are always external processes not able to access VFP internals like data sessions and cursors.
Also, FRXes are their own league, you don't integrate a "Crystal Control" or something of that kind into an FRX, Crystal Reports are standalone.
VFP has no linker whatsoever, so you can't combine any lib with your other code and create a single EXE containing third party library. This goes for any library and OLE or COM component. VFP is itself made with C++, but it has not inherited the compiling capabilities of C++. VFP only ever does so-called late binding of DLLs and OLE classes, which also limits some use of libraries meant for early binding. In regard of compiling, building a setup and redistribution this means any third party tools remain separate DLLs etc. you ship separately from your EXE and the VFP runtime DLLs. Even the VFP runtime DLL itself is something staying a standalone file external to your VFP EXE.

So overall, and this is where someone with experience on how you make use of Crystal Reports may chime in, overall you can only run a Crystal Report, you can't embed it into your EXE. Crystal has it's own data access layer and can most probably like any special standalone report engine access most any database offering am ODBC interface or OLEDB, so your data preparation will be in Crystal, not in VFP. The automation of Crystal might go further than that, but why don't you refer to manuals and help of your trial version. You can't assume I do so for you just because I know my way around VFP better.

Further things are shallow knowledge and assumptions:
As far as I know, Crystal Reports can be stored in RPT files, which is the equivalent of FRX. As they don't belong to the files the VFP runtime can directly cope with, they surely would go separately from a VFP EXE.

You should perhaps take a look at the Install Shield Express Software coming with VFP9 to create Setups, this is not a process you do from within the VFP IDE, this is a "post production" step after building an EXE, you bundle your EXE, runtimes, further DLLs etc into a Setup. Since this is not concerned with the VFP language, you can create setups with any such tool. You also find a lot of info on the free and yet more feature rich Inno Setup in the fox.wikis.com. Such search Inno in the Wiki search on the right-hand side of the header.

Bye, Olaf.
 
1 – You can’t create a Crystal document inside VFP IDE. Crystal is a stand-alone product and you always create the report (.RPT) within Crystal IDE. Your report connect to a data source, can have parameters etc.
We use Crystal 2008 (V.12) but I think it’s also working CR 2016 (V14).

2 – To be able to manipulate Crystal into VFP, you must register Crystal Report runtimes. I think the easiest way is to create an InstallShield installer with the Crystal Merge modules and run it on your development machine (and client machine as well). The merges modules are royalty free.

3 – There are a lot of tips on forums for accessing PEM of a Crystal object.
Here is a small example of changing data connection and exporting the report in PDF format.

Code:
#DEFINE crOpenReportByDefault 0
#DEFINE crOpenReportByTempCopy 1

#DEFINE crEFTPortableDocFormat 31
#DEFINE crEDTDiskFile 1

DIMENSION laTbl[2,2]
laTbl[1,1] = "\\EVOD500\Data_F\Apps\Develop\DbfTeck\cus_mai1.dbf"
laTbl[1,2] = "cus_mai1"

laTbl[2,1] = "\\EVOD500\Data_F\Apps\Develop\DbfTeck\fac_hd01.dbf"
laTbl[2,2] = "fac_hd01"

lcRDC = "CrystalRuntime.Application.11"
loCrystalReport = CREATEOBJECT(lcRDC)

tcReport = "C:\temp\report1.RPT"

loRet = loCrystalReport.OpenReport(tcReport, crOpenReportByDefault)

lnTableCount = loRet.Database.Tables.Count
FOR lnMi = 1 TO lnTableCount 
 lcTable = loRet.Database.Tables(lnMi).Location
 lnScan = ASCAN(laTbl, lcTable, 1, ALEN(laTbl,1),2, 1 + 8)

 IF lnScan <> 0 THEN 
  loRet.Database.Tables(lnMi).ConnectionProperties.Item("Data Source").Value = JUSTPATH(laTbl[lnScan, 1]) + "\"
  loRet.Database.Tables(lnMi).Location = JUSTSTEM(laTbl[lnScan, 1])
 ENDIF							&& lnScan <> 0
 

NEXT

loRet.ExportOptions.FormatType = crEFTPortableDocFormat
loRet.ExportOptions.DestinationType = crEDTDiskFile
loRet.ExportOptions.DiskFileName = "C:\temp\report1.PDF"
loRet.Export(.F.)

Hope it help.
Nro
 
I am not getting the link to download CR11 on the site of crystal report. Is there any free version CR11 available for 1 month?
Just to clear, Are you using Crystal report 14 or 11?
 
>Xrystal 14 or 11
You can answer that from the code. Look at what object NRO creates: CrystalRuntime.Application.11

If that isn't available for you, don't go for a CR11 download, just use either CrystalRuntime.Application.14 or CrystalRuntime.Application, this is not Crystal specific, this is also valid for other OLE automation server classes, eg Word.Application.15 would be Word 2013 and Word.Application.16 is Word 2016, but there always also is the general OLE class name Word.Application or CrystalRuntime.Application, which would address whatever is the mainly registered version, i.e. the default for docx file extension or for rpt file extension.

Bye, Olaf.
 
Hi Beginner

I’m sorry, I was not clear enough (English is not my first language)

The Crystal Report RDC ActiveX is deprecated in Crystal 9. They still ship it until Crystal XI R2 but after that, it’s no longer available. That’s the reason I’m using CrystalRuntime.Application.11 ActiveX control.

You can download the ActiveX Merge Module (11) for free from my previous post. Now, this ActiveX is only needed for VFP automation and it’s working perfectly.

To design your report, you can use the latest Crystal report (ver. 2016) from SAP site. You can download a free trial to test. The full licence cost 495$

SAP is now developing a .NET approach for automation, but again, you can embed your reports into .Net application as well as VFP.

Bye

Nro
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top