SSRS Dynamically setting table position/location - ssrs-2008

I see in Report Builder / design mode, there is a Position and Location property that allows you to set how far from the top or left the table should appear.
My question is, is there a way to set 2 or more tables in the same location (ie top of the page 0 from top, 0 from left) without having them stacked on top of each other in design mode / report builder?
Is there a way to dynamically set that position property?
For instance, here is a sketch of a report in report builder:
top of page
---------------------------
Table 1 (hide) |
|
|
|
Table 2 (show at top) |
|
|
|
|
|
|
|
---------------------------
bottom of page

The location properties for Tablix members are not expression based. However, you can show/hide objects within a report based on a parameter, and this can affect the position of other report items. A simple example:
A report with a Header, two Tablix members and one parameter, HideTable:
The Hidden property for the top Tablix is set to =Parameters!HideTable.Value, i.e. the parameter toggles whether it's displayed. With this setup and layout, SSRS automatically shifts the second Tablix to the top of the report Body when the first Tablix is hidden. See below:
So it's not quite a dynamic location, but by using other features you can achieve the same functionality as above.

In Addition to Answer mentioned by Ian Preston, If Table 1 Does not have data, then we need write as follows:
=Parameters!HideTable.Value or IIF(countrows("Tablix1")<1,True,False)
Here, Tablix1 is First tablix name
So that header would not appear in case of data unavailability in Table1

Related

Crystal Report - Label Printing with a varied page counter

So, our branches are wanting shipping labels created which I have created a template on Crystal reports.
Our issue is using the NofM function. If the user prints one label it will say 1of1 which is correct. We want it so the counter is determined by the number of prints they require for example:
If the user prints 4 pages it will be 1of4 to 4of4.
Any assistance would be appreciated
In Field Explorer, expand 'Special Fields'.
Use the 'Page N of M' special field.
It sounds like you need a solution to duplicate the printing copies based on a parameter.
Option 1. if the max expected quantity is not too large, you can create multiple sections (Details a, Details b, Details c, ...) and use a dynamic suppress condition to hide the sections beyond the quantity parameter.
Option 2. Create a "REPEATER" table with a single column (How_Many) and rows for 1 | 2 | 3 | 4 | 5 | 6 | ...
Now, in your report, add the REPEATER Table and add a Record Selection condition of
{?QTY} >= {Repeater.How_Many}

How do I get a 3 page report in Jaspersoft iReport Designer 4.7

First of all: I've read this question but it is not working for me.
What I need:
I have an SQL query that returns a 3 column set with about 50 rows that looks like this:
year | month | number
2012 | 1 | 35
2012 | 2 | 24
2012 | 3 | 127
and so on. Now I need two different representations of this data. The first one is a 2D bar chart and the second one a table with the numbers presented. I managed to do both, but what I'd like to have for the whole report is, to have 3 pages in total.
First page should be a simple cover page with the title of the report, which I can get by simply adding the title band, as far as I've understood. The second page should be the bar chart (filling the whole page) and the third page should be the table (also filling the whole page).
I've tried the following and didn't get the result I need:
Created 2 subreports (1 for bar, 1 for table), added them both in a main report (in the details band) with a page break in between. The result was 2 pages, but the chart and the table filled only half of their page. When I tried to resize the subreports to the full size of the page I got the error message that they're out of range...
Created 1 report with 2 detail bands. Added the chart into the detail band 1 and the table into the detail band 2. This worked for both elements to be the full size of the page, but the whole compiled report now has 100 pages --> 2 pages for one row in my sql set
So how can I accomplish what I need!? Is it even the right tool to use? Or should I simply create two reports, export them as PDFs and combine the PDFs by hand?
My suggestion - in your SQL query, add a fourth column that concatentates your year and month (let's call that year-month). Create a detail band with the following fields: year, month, number. Create a summary band for your chart with year-month as your x-axis and number as your y-axis. Make the title and summary bands the size of your output paper. In iReport, right-click on the name of your report and go to the Properties box for the report. Check the box for "Summary on a new page."

Is there a way to set column height (or alternatively, convert a standard report to a mail label)?

I'm using Crystal Reports to create a document with one header and two columns of detail per page. What I want is that every page would be like this:
-----------------------
| Group Header |
|_____________________|
Details 1 | Details 4
Details 2 | Details 5
Details 3 | Details 6
----------------------
| Group Footer |
|_____________________|
But what I'm getting is this:
-----------------------
| Group Header |
|_____________________|
Details 1
Details 2
Details 3
Details 4
Details 5
Details 6
----------------------
| Group Footer |
|_____________________|
The footer even gets pushed down to the next page if there are too many records.
I already set the details section to "Format with multiple columns", but didn't format groups by columns. This is because I want each group to fill a whole page, and have only one header that spans the entire width of the page. The details width is only 3.6 in, the page is 8.5 inches with 0.5 in left margin, 0.3 right margin, so I don't think it's the measurements. I set the page footer to print at the bottom of the page, but that only prints the footer at the end of the next page.
What I'm looking for, basically, is something to stop the details from printing downwards and force it to go to the next column. I can't set the data height in the Section Expert (the field's disabled), and I read elsewhere that I could create a mail label instead, but that would mean creating the report all over again (something I'd prefer not to do, as there are too many elements in the report).
Update:
It's definitely not the measurements (data width and distance between columns), as tested. Still struggling with this.
What happens if you select "Across then Down" in details section layout tab? Will you get next layout:
-----------------------
| Group Header |
|_____________________|
Details 1 | Details 2
Details 3 | Details 4
Details 5 | Details 6
----------------------
| Group Footer |
|_____________________|
If not, then you details section is too wide or horizontal gap between sections is too big.
Resolved it myself, but not through using mail labels. In fact I couldn't get it to work with mail labels.
I moved the Group header/footer to the Page header/footer, and then suppressed both (empty) group header and footer. The group footer I set to "New page after". Ticked "Format Groups with multiple column", and adjusted the section heights and data heights to fit on one page.

VFP - Control report from form

iam using VFP 9.0...Iam making an invoice report, what i want to know is how to change the contents of the report by changing lets say a combo box in a form. or be able to use select and where clause in the report...any help would be appreciated :)
EDITED FOR CLARIFICATION (per comments instead of direct add into question)
+-----------------+ +-------------------------+
| Contract Form | | Invoice Form |
| | | |
| | | radioCustomer |
| btnInvoiceForm -------> | comboCustomersList |
+-----------------+ | radioContract |
| comboContractsList |
| |
| btnPreviewReport |
+-------------------------+
If I click on the Preview Invoice button, show all records from contract table where customer id (FK) is = to the id picked from the combo box.
If I picked contract from the radio buttons, the contract combo box would work, showing a list of contract id(s), running the report then would show you the record from the contract table where contract id = the id picked from the combo box...
I've edited the message to hopefully better understand your layout of the form(s) with respective radio button combobox controls respectively enabled/disabled. I think you'll need to draw up two distinct reports no matter what showing respective content, then call each one based on the radio button setting... Such as in the "btnPreviewReport" object CLICK event... I've roughed-in on the sample...
if not empty( Thisform.radioControl.radioCustomer.Value )
*/ Customer radio button was selected
xCustomerID = comboCustomersList.Value
*/ Run your Query
select ... from YourTable where ... into cursor C_SampleCustomerData
*/ Run the report
report form YourCustomerReport preview
else
*/ Contract radio button was selected
*/ Customer radio button was selected
xContractID = comboContractsList.Value
*/ Run your Query
select ... from YourTable where ... into cursor C_SampleContractData
*/ Run the report
report form YourContractReport preview
endif
Again, I tried the form as best from your description.
EDIT -- second comment clarification...
The nice thing about reports in VFP is they do not pre-require any hard DBF() in the data environment. However, it would be good to have your data fields set to an Alias.Field reference you are EXPECTING to have. So, if your querying of the data for the Customer report should always have the same expected alias result...
ex:
// pre-close in case the alias we want was already left open previously
use in select( "C_CustomerResults" )
select c1.*;
from YourCustomerTable c1;
where c1.ID = SomeChosenID;
into cursor C_CustomerResults readwrite
Then, in your report, have all your fields to something like
C_CustomerResults.FirstName
C_CustomerResults.LastName
C_CustomerResults.OtherField
This example uses an otherwise long alias name but just for clarification of handling.
I would do a similar for your "contract" results alias. As long as that alias is in use, the report will run against whatever is the current table in use. Nothing fancy, no other prep, no data environment settings needed in the report...
By pre-querying a sample of the data you would have in the report can help you in "roughing" the layout of your report. Then, finish your form to run the query and show the report and you're done.
EDIT -- revised comment follow-up again
Yes... for your customer invoice with multiple lines, same thing... however your report has a header band for things you want to only show once at the top of the page, and a detail band where you would want to show content for your "each line item" of the invoice, and a report footer to show any totals. Depending on complexity, you can add additional "Data Groups" in the report, but start with this now. It sounds like you need to get your feet wet with something working first before you expand on it.
If VFP is your development platform, another website that has dedicated experts in VFP all the time is at www.UniversalThread.com. They also support other forums, but in VFP, they'll get 100+ questions thrown at it a day...

How do I make a Pie Chart in Crystal Reports that is JOINed?

I'm pretty new to Crystal Reports and I can create Pie Charts just fine, but I can't figure out how to chart a JOIN. For example, I have two tables "A" and "B". In the "link" tab of the Database Expert I've drug a line so that A.FK goes to B.PK.
Table A Table B
-------- --------
PK | FK PK | FK
0 | 1 1 | Gizmos
1 | 1 2 | Gadgets
2 | 2
The pie chart for A.FK would come out looking correct but the value in A.FK would be used in the legend, when I'm expecting the JOINed value of B.FK. So instead of my chart having two slices called 1 and 2, I want the slices to read Gizmos and Gadgets.
Can anyone please assist? Thanks
This is because you are grouping the report by A.FK - you need to change it to group by B.FK.
To do this:
Right-click on your chart and select Chart Expert.
In the Chart Expert dialog, click on the Data tab.
Select B.FK from the Available fields, and click on the first > button to add it to the list of grouping fields (to the right).
Select A.FK from the list of grouping fields and click on the first < button to remove it from the list. Your chart should now be grouped on change of B.FK.
Click OK at the bottom of the dialog.