How do I load images dynamically in Crystal Reports XI - crystal-reports

HI I am running a Crystal Reports XI from .NET application. I am passing parameter name as company and report should display the logo depends on company.
How we can load the image dynamically in crystal report.(how to write formula to load the image from specific directory)

A simple solution for Crystal Reports XI is to pass the image's URL as a parameter to the report, then use it as the picture's graphic location.
Create a string parameter field, call it 'imageUrl'.
Add an image (Insert | Picture...) to the report (it's a placeholder)
Change the image's Graphic Location:
right click image
select Format Graphic...
select Picture tab
click the conditional-formula button (looks like x+2)
set the formula's text to '{?imageUrl}' (without the single quotes)
save the formula and click the OK button
save the report
Run the report and set the imageUrl's value accordingly.
Alternately, you could use a CASE statement in a formula field for the same effect; simply change the image's conditional-formula field to reference the formula field instead of the parameter field.

I don't think you can. The only way I've found to do that is to embed each image in a different section of the report and conditionally suppressing the section depending on the company parameter's value.

Related

CR | Open subreport by clicking on database field in main report

this case is a little more difficult I think.
In my main report I have material numbers displayed in a cross table.
From time to time I need to show more details for one of the material numbers. Therefore I want to double click this field and then copy the corresponding material number to the sub report (directly in the parameter field). Another fixed parameter field is the date, which has the max date "today" and the min date "today-365d".
Moreover I don´t want to make the sub-report visible in the normal report the whole time. It should just be visible if I double click a material number.
Is there any possible way to that?
Thanks in advance!
You can do this in 2 ways, with either an on-demand sub report or by utilising the drill down
Using sub reports
In your main report go to insert>Subreport. Create your sub report with the detail you wish to see, then click the tick box for "On-demand subreport". Place the sub report in the details section along with your material numbers. You'll see it appear like a hyperlink. Right click then Format Subreport>Subreport tab. You can change the Subreport caption to the material number from your data by clicking the formula button for "On-demand Subreport Caption" and entering your material number field name as the result of the formula.
Whjen you ruin the report you can click the link to see the etail in the subreport
Drill down method
Create a report with all the detail you need in the details section. Group by material number then in section expert (Report menu) use the tick box to "Hide (Drill-Down OK)" the details section. Now when you preview the report the group header will show with the material number, clicking this group header will open the details section.

How to edit a pdf generated using iReport?

I have generated this pdf using iReport. Now while viewing this pdf using document viewer, I need to edit that gross amount field and take print out. No need to saving the edited file. How is this possible?
iReports Custom Fields for columns (sum, average, etc)
Right-Click on Variables and click Create Variable
Click on the new variable
a. Notice the properties on the right
Rename the variable accordingly
Change the Value Class Name to the correct Data Type
a. You can search by clicking the 3 dots
Select the correct type of calculation
Change the Expression
a. Click the little icon
b. Select the column you are looking to do the calculation for
c. Click finish
Set Initial Value Expression to 0
Set the increment type to none
Leave Incrementer Factory Class Name blank
Set the Reset Type (usually report)
Drag a new Text Field to stage (Usually in Last Page Footer, or Column Footer)
Double Click the new Text Field
Clear the expression “Text Field”
Select the new variable
Click finish
Put the new text in a desirable position 

Jaspersoft studio calculate variables before detail band

Jaspersoft studio 6.2.
The report below, there are 3 bands: title, detail, and summary. Detail is in the middle. Look at "Activated staff" on the top on title band, it used a variable (activatedstaffcount1) as expression. The variable sum all activated staff counts in the detail. However it shows null. The bottom one is in the summary band and used the same variable but it shows correct number. The middle section is the data (detail band). I want to show aggregated result before the display data(detail band), how can I do it?
Try to set also Evaluation time in the text field which contains that variable to the "Report".
If the text field is outside of the table - try to return value into the parameter back from dataset and display that parameter at the end of report evaluation.

Crystal Reports - Add variable into Text box

I'm creating a customized report that needs to insert some variable data extracted from sql, I've create some views and formula fields, now I need to insert that data in the middle of a paragraph, but always return a blanch field.
This is possible to have?
i.e:
some text 607.619 some text
Thanks in advance
Best regards
carlos
Create a Text Box
Type Whatever you want in that text box
From the field explorer drag the field (Or formala) and place it inside the text box
Your done

Passing Value from Sub Report To MainReport on Crystal Reports

I'm currently having a problem with regards on Crystal Report Shared Variable. this is my situation.
I have a Report consist of multiple sub reports (and of course the main report). i need to expose a value in main report from Sub Report, but the problem is i need to Display it before the sub report was rendered. Please see the image below:
As you can see the image above, i need to display the value below (Sub report with RED encircle with VALUE) on the TOP (Red encircle without value).
I used Shared Variable but i think it will not work since the TOP will be first rendered (where i need to display the Value from subreport) before the Below(where i need to get the value).
Is it possible?
The section that displays the value has already been rendered by the time the other section sets the value of the shared variable.
Two options:
add a second instance of the subreport to a section that precedes the section when you want to display its value; you won't be able to suppress either the section or the subreport, so you will need to make the subreport as small as possible and change the font colors to white
use a sql-expression field to calculate the desired value and avoid the subreport complexity altogether