Dynamic Reports using SSRS - ssrs-2008

Let me declare... I am a newbie at this filling in the spot temporarily at the moment.
Problem: Develop a application summary report using SSRS 2008( the completed product should be a RDL file, which can be deployed to the SSRS Server) for the online application completed by the applicant.
A little bit of background: The applicant fills in an online application using our web application, where he completes required and optional fields. The app summary report, is provided to the applicant filling out the application as a summary of his app and should display only the fields completed by the applicant.
Example:
Lest us say John Smith lives at
Add Line 1: 123 Any Street
Add Line 2: Null
City: Some City
State: Some State
And his spouse Jane Smith lives at
Add Line 1: 321 Any other Street
Add Line 2: Apt A
City: Some City
State: Some State
So in the report, the null field (Add Line 2) should not be displayed for john but displayed for Jane. When I say not displayed, meaning, the field label should be hidden the and report should adjust the spacing to not show a skipped blank line in the report.
We have about 1000 such fields that can or cannot be answered by the applicant. So the report should be generic and use as much of inbuilt functionality as possible.
If needed, an Xml containing key value pairs of fields and responses. this Xml can be made so that it can contain all fields and unanswered responses as null or only answered responses. i am not sure how this would help but putting it out there if needed.
I have done simple reports, but i have no idea on how to approach this situation. Any help will be great help.
Thanks.

I have had a similar situation and ended up using this approach within a textbox. Taking your example above, you would have this setup for your fields within the textbox, with the [ ] being fields from the dataset:
Name: [first_name] [m_name] [last_name]
Add Line 1: [address_1]
[expression]City: [city_name]
State: [state_name]
Zip: [zip_code]
Note that the expression and the City have no space between them. What happens is the city will be on its current line when [address_2] is null and move to the next line when there is an address line 2, using this expression:
=IIF(IsNothing(Fields!address_2.Value), "",
“Add Line 2: “ & Fields!address_2.Value & VbCrLF)
When the IFF is true and [address_2] is null the expression will write “” (Nothing) and [city_name] will remain on the same line. When the IFF is false and there is an [address_2] the label “Add Line 2” will be written along with the value of [address_2] and the [city_name] will be moved to the next line by “VbCrLf”. A more robust method that handles if [address-2] has a string of length 0 or a few spaces is this expression:
=IIF(IsNothing(Fields!address_2.Value) OR Len(Trim(Fields!address_2.Value)) < 1, "",
“Add Line 2: “ & Fields!address_2.Value & VbCrLF)
This stops the strange double space when a field is empty but not null; something similar woks great for middle names. Hopefully this is helpful to you or someone else reading this post.

This was really simple...
Lets say we have a report which is in a tabular format using rectangles and textboxes,
--------------------
|FIRST NAME : AAAA |
|LAST NAME : BBBB |
|PHONE: XXX-XXX-XXXX|
--------------------
Use the following expression to control visibility of the controls that you want to hide
=IsNothing(First(Fields!WorkPhoneNumber.Value, "DataSet1"))
Make sure all the controls are of the same height and width. I created a row with just 2 controls (the label text box and the value text box) and set their visibility using the value of the value text box as described in the expression above.
Since the row had just two controls the hiding the would auto adjust the layout as i desired.

Related

SSRS does not work when input parameter has a + sign

I'm creating a report which has as input parameters: id and name. These parameters are used in the where clause of the select from which I get the records to display in my list.
The problem is that if there is a + sign into the name the parameter (that I print on the page to display the filter) name appears with a space instead:
Input parameter = "record+story"
Parameter shown in report: "record story"
So the result of the select is empty, since the name doesn't match!
What am I missing?
EDIT: I open the report through a client application, based on VB6. There is a main page with a table and a list od ids, when I click on a row of the list it redirects me to an IE page performing the filtering and showing only the needed data.
The parameters are: id - Integer, and name - text.
When it opens the IE page I see that if the name contains a plus sign there appears instead a space, which of course is wrong, therefore the resulting report is empty.
I already tried to add the System.Web reference to VB6 in the client application, but it doesn't work.
Here a picture to clarify what I mean.
Thank you
C.
In the end I got the solution. I only need to encode my parameter so that the + sign is read as a + sign. This is achieved by using the hex value in the code behind:
example: namewithplussign ==> replace(namewithplussign , "+", "%2b")

Crystal 2013 - Is field in field possible?

i am creating a template for an invoice-document. There are some text-blocks i want to include from external via DB-Field so that i can manipulate the text without changing the RPT-File. As some of the Text-Block also inlude VARS i was wondering if there is a chance to also include the VAR itself into the text-block, meaning we have a Field including a Field.
Is this possible? My first tests failed as the Name of the Var is interpreted as text and just printed but not changed into the VAR-Value.
--- Edit ---
Example:
Database-Field: {Table1.Value} -> 4.00
Database-Field: {Table1.Text} -> 'The value is {Table1.Value}'
If i now add {Table1.Text} into the report, it should show as "The value is 4.00"
Yes this is possible. Create a regular text box and set its text. Then drag a database field or a formula from the field explorer on the text box.

Formatting a Second Page of Details

This is a problem I've managed to come up with a semi-solution for in the past, but I thought someone else might know better.
I have a report in Crystal Reports 10 that is used as an order summary form for a production area. We have standard products that only have one item per code, and then we have kits. A kit will have one primary item, and a secondary item, both of which need their own page in this summary as they go to different areas.
To accomplish this I've taken the normal details area from the report and made a copy of each section. This second set of details sections only shows when a record contains a kit, and they force a new page before them. To the average observer this makes it appear as though there are two separate items on the order, when in reality there is only one.
In my page header there is a flag that needs to show only on these secondary pages. My problem is that there is no special attribute for these second pages that sets them apart from the first page of a record. To make this formatting happen I've created a somewhat effective formula, but it doesn't work in all possible configurations.
The formula is:
(PageNumber = 2
or ({%kit count} = 1 and (PageNumber - 1) = RecordNumber)
or ({%kit count} > 1 and (PageNumber -2) = RecordNumber)) then false
%kit count is just a formula that gets a total count for kit codes in the report.
Currently this works only on a few specific cases. I'm sure there's some kind of pattern in the available values that I could work with, but I'm just not seeing it.
I need to be able to trigger this formula on every second page on a kit. How can I accomplish that?
EDIT: Screenshots as requested. (Brace yourselves)
(Original at http://cl.ly/392f033Y131e3r0l100V)
(Original at http://cl.ly/2x1D0t0W0S0j0F0h0S28)
It's quite hard to fully understand what you're trying to do without a discussion. Here is the solution to what I think you want to do with some made up data:
OrderNo Line Kit Rush
1 1 a 0
1 1 b 0
1 2 NULL 0
1 3 NULL 1
1 4 NULL 1
I create a group based on a formula (pretend OrderNo and Line are varchar so I don't have to cast :)
if {Rush} = 1 then
{OrderNo} & '-Rush'
else if isnull({Kit}) then
{OrderNo} & '-' & {Line}
else
{OrderNo} & '-' & {Line} & '-' & {Kit}
Then in the group header I place all of the stuff you currently have in your page header and enable Repeat Group Header on each Page.
Then finally put my detail in.

Only the first letter of a product description appears in zen cart

I'm working on this zen cart site. A Love Supreme Shop
In new and featured listings only the first letter of the product description appears whether I use a custom template or the default. I'm using 1.3.9 but the data has come from a 1.3.0 site.
When product descriptions are shown on all products they show up fine.
Is the description being put into an array incorrectly and only the first element of the array being displayed?
Go to admin->configuration->new listing, and look at the value of Display Product Description. I wonder if yours is 0. It should be 120 or 150. If you don't see this setting, your database is missing values.
Failing that look at the file
includes/templates/YOUR_TEMPLATE/templates/tpl_modules_products_new_listing.php
and see how description is being handled.
Thanks Scott that helped me get to the root of the problem :
On my admin->configuration->new listing->Display Product Description page there is no textbox to change the number of characters displayed.
There is only a question :
Do you want to display the Product Description - First 150 characters?
Followed by the options 0 = off and 1 = on
I checked another zen cart running on another server and it has the textbox to change the number of characters.
I followed your instructions to look at :
includes/templates/YOUR_TEMPLATE/templates/tpl_modules_products_new_listing.php
I edited the code that displays the product description replacing the value PRODUCT_NEW_LIST_DESCRIPTION with 150.
This worked.
However the underlying problem is solved here :
Solution on Zen Cart Forum
SELECT *
FROM configuration
WHERE configuration_title = 'display product description';
This returns 4 records
Changing configuration_value from 1 to 150
Changing configuration_description from :
Do you want to display the Product Description - First 150
characters?
to :
Do you want to display the Product Description?0= OFF150= Suggested Length, or enter the maximum number of characters to display
and changing the set_function from :
zen_cfg_select_option(array('0', '1'),
to :
NULL
Thanks for the assistance #Scott Wilson.
Still don't know the route cause of the problem. Probably not migrating the database properly.

How to add a simple text label in a jqGrid form?

When using the Add or Edit form from the pager I'm wondering how a simple static label can be added in the form without it creating any additional columns in it's affect on colNames[]'s and colModel[]'s. For example I have a quite simple typical Add form which opens from the pager containing a few label's and form elements: Name, Email, Web Site, etc., and then the lower section of the form has a few drop down menus containing the number 1 through 10 with the idea being to ask the user to pick a value between 1 and 10 to put a value on the importance to them about the product or service which is listed beside it. Just above this section I want to add some text only to give a brief instruction asking the user to "Choose the importance of the following products and services using the scale: [1=Low interest --- 10=Very high interest]". I cannot figure out how to get a text label inserted in the form without having to define a column with a formoption{} etc which is not needed for just some descriptive text. I know about the "bottominfo: 'some text'" for adding text to the bottom of the form but I need to insert some text similar to that mid-way (or other positions) in the form without it affecting the tabular structure of the grid. Is this even possible? TIA.
You can modify Edit or Add forms inside of afterShowForm. The ids of the form fields are like "tr_Name". There consist from "tr_" prefix and the corresponding column name.
I modified the code example from my old answer so that in the Add dialod there exist an additional line with the bold text "Additional Information:". In the "Edit" dialog (like one want in the original question) the input field for one column is disabled. You can see the example live here. I hope that a working code example can say more as a lot of words.