embed Word docx in Crystal Reprot

Support for Crystal Reports within Jiwa.

embed Word docx in Crystal Reprot

Postby swoodsdw » Mon Oct 08, 2018 9:59 am

I have modified a copy of the Jiwa SO invoice report to embed a Word document that will contain various messages, i.e. price specials, Merry Christmas etc. This will allow the client to update the Word document with new messages without needing me to update the Crystal Report.
I have tested on my network with the Word document on a network drive with same mapping and path as the client network. When I run the invoice report in Jiwa on my network it automatically updates with the latest contents of the Word document.
When I run this on Clients server Word contents are automatically updated but when a user runs this report from a PC connected to the network the latest Word contents are ignored.
Presumably some sort of permissions issue.
Do you have any thoughts on what the problem might be?

Thanks
Steve
Steve Wood
SWOOD financial solutions
Adelaide
swoodsdw
I'm new here
I'm new here
 
Posts: 8
Joined: Sun Mar 02, 2008 2:43 pm

Re: embed Word docx in Crystal Reprot

Postby Scott.Pearce » Mon Oct 08, 2018 11:28 am

Eliminate the possibility of a permissions issue first. i.e. Run the report with local word doc with the user as local administrator. If that works OK, move to the next step - place the word document onto a network share, etc.
Scott Pearce
Senior Analyst/Programmer
Jiwa Financials
User avatar
Scott.Pearce
Senpai
Senpai
 
Posts: 742
Joined: Tue Feb 12, 2008 11:27 am
Location: New South Wales, Australia
Topics Solved: 221

Re: embed Word docx in Crystal Reprot

Postby swoodsdw » Wed Oct 10, 2018 1:09 pm

I have done the following on my internal server/laptop environment successfully.
1. Inserted OLE object C:\Temp\SalesSpecials.docx
2. Inserted OLE object J:\Jiwa\SalesSpecials.docx (mapped to C:\Jiwa\SalesSpecials.docx) works with subdirectories
3. Inserted OLE object J:\Jiwa\Jiwa 7\SalesSpecials.docx (mapped to C:\Jiwa\Jiwa 7\SalesSpecials.docx) works with space in path
Running the report from Jiwa on the server and laptop always updated with the latest text in the word document.

Then tried similar on the clients server.
1. Inserted OLE object C:\Temp\SalesSpecials.docx was always successful and displayed latest word document text.
2. Inserted OLE object C:\ClientApps\Jiwa\SalesSpecials.docx always updated the word document text.
J:\ mapped to file share C:\ClientApps
3. Inserted OLE object J:\Jiwa\SalesSpecials.docx did not update the word document text. Report only displayed saved text from when the CR was last updated.
I can edit the word document using the J:\ drive so don't think permissions are an issue.

Then in the OLE object format option hyperlink tab tried to override the paths with paths like...
\\servername\sharename\Jiwa\SalesSpecials.docx
\\%COMPUTERNAME%\sharename\Jiwa\SalesSpecials.docx
but still no luck getting report to read latest word document text.
Steve Wood
SWOOD financial solutions
Adelaide
swoodsdw
I'm new here
I'm new here
 
Posts: 8
Joined: Sun Mar 02, 2008 2:43 pm

Re: embed Word docx in Crystal Reprot

Postby Scott.Pearce » Wed Oct 10, 2018 3:50 pm

Try this:

Get to the state in your last point 3 (J:\Jiwa\SalesSpecials.docx on the clients server) such that it isn't working.
Exit Jiwa
Modify J:\Jiwa\SalesSpecials.docx
Log in to Jiwa
Run report - is it using the updated J:\Jiwa\SalesSpecials.docx text?


Also, here is another procedure to try:

Get to the state in your last point 3 (J:\Jiwa\SalesSpecials.docx on the clients server) such that it isn't working.
Exit Jiwa
Modify J:\Jiwa\SalesSpecials.docx
Delete the contents of the "ReportCache" folder (The "ReportCache" folder is a subfolder in wherever you installed Jiwa to).
Log in to Jiwa
Run report - is it using the updated J:\Jiwa\SalesSpecials.docx text?

I'm starting to think along the lines of the report being cached. Remember, the reports are in the database. When you run a report, Jiwa looks at the file hash stored against the report in the database (in the SY_Reports table), and compares it to the hash of the report file in the ReportCache folder. If the hashes don't match (or if the report is not in the ReportCache folder at all), then the report is saved out from the database to the file-system, then executed as normal.

Another possibility is that when a report is initially executed in Jiwa, Jiwa will continue to use the *in memory* copy of the report for subsequent executions - only exiting Jiwa will cause the system to again compare the database file hash to the filesystem file hash.

Taking the above knowledge into account, please test further and post back with results.
Scott Pearce
Senior Analyst/Programmer
Jiwa Financials
User avatar
Scott.Pearce
Senpai
Senpai
 
Posts: 742
Joined: Tue Feb 12, 2008 11:27 am
Location: New South Wales, Australia
Topics Solved: 221

Re: embed Word docx in Crystal Report

Postby swoodsdw » Wed Oct 10, 2018 5:28 pm

Tried option 1:
Logoff Jiwa
modify J:\Jiwa\SalesSpecials.docx
Logon Jiwa
No Change to the SO report.

Option 2:
My custom report is not in the ReportCache folder of the Jiwa installation directory. I also have another 10-12 custom reports and none of these are in the ReportCache folder. There are 229 files in the ReportCache folder but 246 files in the Report Maintenance form.

I found the record for my report in SY_Report and set FileHash = xxxxxxx using SQL. Logged on to Jiwa and still no change in the report output.
Imported my report again and saved. Reran report and no change to the output.
Report not in the ReportCache folder.
Steve Wood
SWOOD financial solutions
Adelaide
swoodsdw
I'm new here
I'm new here
 
Posts: 8
Joined: Sun Mar 02, 2008 2:43 pm

Re: embed Word docx in Crystal Reprot

Postby swoodsdw » Wed Oct 10, 2018 5:36 pm

Checked another client with custom reports.
ReportCache folder has a combination of Jiwa financials and swood custom reports. But latest report is dated 28/9/2017 (Jiwa 7.01 build?). Would appear that since 7.01 was installed new custom reports imported into database are not saved to ReportCache?
Steve Wood
SWOOD financial solutions
Adelaide
swoodsdw
I'm new here
I'm new here
 
Posts: 8
Joined: Sun Mar 02, 2008 2:43 pm

Re: embed Word docx in Crystal Reprot

Postby Scott.Pearce » Thu Oct 11, 2018 8:49 am

Yeah, you're right - checking the code it appears ReportCache is not used for executing the report, but for upgrades. I found that this is the path used when executing a report:

Code: Select all
ReportsFolder = Replace(Replace(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) & "\" & My.Application.Info.CompanyName & "\" & My.Application.Info.ProductName & "\" & My.Application.Info.Version.Major & "." & My.Application.Info.Version.Minor & "." & My.Application.Info.Version.Build & "\" & MakeSafeFileName(Environment.UserName) & "\" & MakeSafeFileName(ServerName) & "\" & DatabaseName & "\Reports", "(", "_"), ")", "_")


So the path used would be something like "C:\ProgramData\Jiwa Financials\Jiwa 7\7.2.0\scottpearce\localhost\JiwaDemo\Reports"

Perhaps try the aforementioned options again, but using "C:\ProgramData\Jiwa Financials\Jiwa 7\7.2.0\scottpearce\localhost\JiwaDemo\Reports" (or whatever it is in your case) instead of the ReportCache folder?
Scott Pearce
Senior Analyst/Programmer
Jiwa Financials
User avatar
Scott.Pearce
Senpai
Senpai
 
Posts: 742
Joined: Tue Feb 12, 2008 11:27 am
Location: New South Wales, Australia
Topics Solved: 221

Re: embed Word docx in Crystal Reprot

Postby swoodsdw » Thu Oct 11, 2018 10:23 am

Reran option 2 using C:\ProgramData\..\Reports and deleting .rpt.

New content of word doc is not included in the report.

If the embedded Word doc is embedded in the report as C:\... then new content is updated in the report. However when use J:\.. mapped to same C:\ location changes to the Word content is not updated.
Steve Wood
SWOOD financial solutions
Adelaide
swoodsdw
I'm new here
I'm new here
 
Posts: 8
Joined: Sun Mar 02, 2008 2:43 pm

Re: embed Word docx in Crystal Reprot

Postby Scott.Pearce » Mon Feb 04, 2019 9:14 am

Did you ever get this one resolved?
Scott Pearce
Senior Analyst/Programmer
Jiwa Financials
User avatar
Scott.Pearce
Senpai
Senpai
 
Posts: 742
Joined: Tue Feb 12, 2008 11:27 am
Location: New South Wales, Australia
Topics Solved: 221

Re: embed Word docx in Crystal Reprot

Postby swoodsdw » Thu Aug 29, 2019 11:45 am

Hi Scott,
Never got it working at required client site. But got it working at other sites.
I think it is the way their environment/network is setup.
Steve
Steve Wood
SWOOD financial solutions
Adelaide
swoodsdw
I'm new here
I'm new here
 
Posts: 8
Joined: Sun Mar 02, 2008 2:43 pm


Return to Crystal Reports

Who is online

Users browsing this forum: No registered users and 4 guests