In SSRS 2008, is there any way to add all dataset fields to a table at once? - ssrs-2008

I'm working with SSRS for the first time. When adding a table to a report, is there any way to add all fields of a dataset to it at once or does it have to be done individually? Drag & drop, insert column -> right is a pain when there are a lot of fields that are being displayed.

It's a bit of a workaround, but the "Add new report" wizard automatically creates a table with the specified columns and groups from your given dataset. I don't believe there's a way to trigger this functionality from within an existing report, but you could create a "sacrificial" report to get what you're looking for - run through the wizard, generate the table, and copy / paste it into your original report. As long as your datasets are the same, it should work just fine...
Hope this helps.

I have a similar problem as the op and am new to SSRS/BIDS. And, I am updating a previously created report which (for me) is too complex to just quickly re-create using the "wizard generation" as the datasource is a web service (with code-generated web service parameters, lots of calc'd datasource fields, etc). It is faster to just copy the .rdl, delete all, and create the table manually.
I thought I would add that (only a little better than op's method, but nonetheless it is time-saving) you can just drag and drop to populate columns w/o the "right click > insert column > right". Just drag the dataset field to the place you want it in the table and BIDS/SSRS will automatically insert a new column. It also helps to drag the latter columns first (i.e. always inserting a previous column) so you don't have to scroll to the right all the time.

I was looking for the similar thing and I have figured this out. Open your report in Report Builder 3.0 which is a free BI tool by Microsoft. Go to Insert > Table wizzard. Then just follow the wizard steps to generate auto columns. Save and reopen the file in your visual studio, file will refresh itself.
Ved

#Kevin Fisher actually there is no need a workaround. There is way to do this out of the box of Report Builder 3. Open your existing favorite report template. on the tool bar, click on INSERT tab, look for TABLE icon, click on the down-ward arrow at the bottom of the TABLE icon, then choose TABLE WIZARD. Then I guess you know what to do from here. -hope this help.

I agree that there is no way to bring all of the columns over from the data set to a table easily. But I came up with a method that helped me:
Insert a blank table (this usually gives you 3 columns). Then insert columns to the right of the table (right click, Insert Column, To the Right), as many times as you need in order for it to equal the number of columns in your data set.
Once you have all the blank columns created in your table, click inside a table cell box and use the drop-down to select the field. This has the added benefit of allowing you to get the fields in the correct order, since I've noticed that the field names in the dataset don't always appear in the same order as the SQL stored proc output.

Related

Two SQL query inside single JasperReport

We are generating reports based on iReports and JasperReports for web application.
Using iReports I found I am struck with big problem.
I want to use two SQL query to fill up my main report...
In query designer I can only write one query..
For another query I cannot use sub-reports...
How do I write second query which will return different fields and include them in my report..
Please guide...
I cannot use sub-reports...
Yes, adding a table to your report is as easy as adding a field. Just drag it from the palette and drop it in the report where you need to have it.
Add a new Table data source. I assume this was done.
Once the data source is configured, you could design your table UI using the wizard.
just click on next or finish to close the wizard.
To add a parameter in data set (if needed), Navigate to your data set using the report inspector. Expand your data set. You would find the parameters menu. Right click to add the new parameter.
Now right click on your table and select edit table data source. Here you will find options to pass parameters to your table from the main report. Passing parameters to your table should be as simple as you do in sub reports. Select the parameter just created from the drop down list box and pass the required value.
In the Data set run Dialog box that appears, please make sure of the data set and the report connection you are using.
You are done configuring the table with this, next you will place the fields in the cells of table for displaying the data.
You are getting your document has no pages since the main report query does not return any rows i guess. For your table to be executed your main report must return at least a row
Hope this helps you.
Good Luck!!
As far as Ireports are concerned, the main report can comprise only one query. And if you wanna use multiple queries in your report, it is possible in the following ways.
Sub Report
Table Dataset.
sub Dataset.
since you don wish to use a sub report, you can go for a Table Dataset. Anything you would do with a sub report is possible with table dataset too(Except for returning variables). You can use sub datasets with charts and graphs. Table set will be of use to you i hope.

Hide duplicate row SSRS 2008 R2

Duplicated data is coming in my report because source table has duplicate data. Without creating group, I want to hide duplicate data writing expression. So what I did: I select table row and put a expression for hidden property of table row.
The expression was like =(Previous(Fields!ID.Value) = Fields!ID.Value)
but it did not work ... Still duplicate data is showing. So tell me how to suppress duplicate rows in ssrs writing expression not by grouping.
You probably should try these options first:
Try to clean the duplicate data at the source.
Change your source query so the duplicates don't appear in the dataset. (e.g. SELECT DISTINCT)
If not, on the row's Visibility Hidden property you can use the Previous function:
=iif(Fields!YourField.Value = Previous(Fields!YourField.Value), True, False)
You would have to sort on the YourField column for it to work.
I was putting the expression above also until I started using the "Hide Duplicates" line in the properties pane. You basically just select the row, in the dropdown choose your Dataset and that's it. any duplicates will be hidden. Also if you just want to hide certain textboxes duplicates you can do the same as i stated earlier except click on the textbox and not the row. Just another alternative, i'm aware you said using an expression.
You can do it using expression or "Hide Duplicates" options from cell or row properties.
Expressions :
=IIF(Fields!YourField.Value = Previous(Fields!YourField.Value), True, False)
Hide Duplicates Steps:
Select row or cell
Click on F4 key on your Keyboard
Look for "Hide Duplicates"
Choose your DataSet from the dropdownlist
Done, I hope that helps
As an alternative option, you can do it by setting row groups. In a report I was trying to create, the Hide Duplicates property wouldn't behave correctly because of using the same dataset multiple times in a list container.
All you need to do is set the row group properties for the default row group (rightclick the grey row header, and go to Row Group then Group Properties), and add Group expressions on the General tab. Add as many as you need for each field. It's like the Remove Duplicates tool in Microsoft Excel
Sometimes the Hide Duplicates option does apply to the report content. If you add a =Sum(Field!Field_Name.Value) sum around field in the cell, it suppresses the copy from previous record. Of course, strictly speaking this is a solution where the incoming data set has NULL rows for the cells with the issue.
Since the using of Previous function in SSRS compare to the only record previous to it, thus it might cause the duplicate of records still shown if the repeated records not next to each other.
Use the sorting on each table you apply the Previous function, it should resolve the "non next to each other" duplicate records as well.

How copy data from Excel to a table using Oracle SQL Developer

Is there any alternative way to copy the data from Excel sheet and paste it into a table using Oracle SQL Developer!?
For now I am using (PL/SQL Developer) by writing (for update) at the end of the select statement, Ex:
Select * from ABD
for update
Then paste the columns from Excel to the table...
Regards
Adel
It's not exactly copy and paste but you can import data from Excel using Oracle SQL Developer.
Navigate to the table you want to import the data into and click on the Data tab.
After clicking on the data tab you should notice a drop down that says Actions...
Click Actions... and select the bottom option Import Data...
Then just follow the wizard to select the correct sheet, and columns that you want to import.
EDIT : To view the data tab :
Select the SCHEMA where your table is created.(Choose from the Connections tab on the left pane).
Right click on the SCHEMA and choose SCHEMA BROWSER.
Select your table from the list (by giving your schema).
Now you will see the DATA tab.
Click on Actions and Import Data...
None of these options show up for me. The way to paste data from Excel is as follows:
Add an extra column to the left of your spreadsheet data (if you
don't have row numbers showing in PL/SQL Developer you may not have
to have an extra empty column to the left).
Copy the rows of data from your spreadsheet including the empty
column.
In PL/SQL Developer, open your table in edit mode. You can
right-click the table name in the object browser and select Edit Data
or write your own select statement that includes the rowid and click
the lock icon. Be sure your columns are ordered the same as in your
spreadsheet.
Here's the part that took me forever to figure out: click on the left
side of the first empty row to highlight it. It will not work if you
don't have the first empty row highlighted.
Paste as usual using Ctrl+V or right-click Paste.
I couldn't find this info anywhere when I needed it, so I wanted to be sure to post it.
You may directly right-click on the table name - that also shows the "Import Data.." option.Then you can follow few simple steps & succeed.
Do anyone know how to import a new table with data from excel?
Click on "Tables" in "Connections" window, choose "Import data ...", follow the wizard and you will be asked for name for new table.
For PLSQL version 9.0.0.1601
From the context menu of the Table, choose "Edit Data"
Insert or edit the data
Post change

Creating a table in Crystal Reports Basic (one built in vs2008)?

Is it possible to create a table with this crystal reports, because I need to layout or format my data into a table(not cross tab), is there a way to do this cause I think my tool box is only limited to lines and boxes and basic shapes.
There's a few things you can do to make it look like a table:
Create Each row in your report represents a row in the table.
Put a border/box around the table use the 'Insert Box' from the toolbar and simple start drawing the box in the header of the (or group header) and finish in the footer (or group footer) and when you preview the report you'll see a box around the whole table [report]
Column grid lines can easily be done by linking the top and bottom of your box. they will then expand out in preview mode.
Top Tip: Zooming right in, to say 300%, makes getting the joins much easier, and investigate snap-to-grid you may want to simple disable it it may actually make life easier,(when ultimate precision is required)
If you need to display the data as a table, you can get creative with details, groups, subsections, and formulae. For example, the formula sum({A},{B}) adds all the values of {A} for each group {B} (best used in a group footer). If you have any specific questions, I can try to answer them.
Sorry, but Crystal reports can not create tables. It can execute a stored procedure that creates tables, but that's really the procedure creating the tables.

Crystal Reports: Cross-Tab Column Arrangements

I am looking for a way out in cross tab, so that if the columns exceed in cross tab, they shouldnt go on next page..rather a new cross-tab should repeat after the first one.
For example, two columns are displayed in a cross tab :
Now if a new column is added, and assuming that it could not be accomodated within the given page width limit, it will go to a page next to it in CR by default.
But in my report it is required to be shown below the first cross tab (and not on next page), which will look as follows:
Please do suggest me if there's a way out :)
Thanks in advance
Your question is perfectly reasonable, but I'm pretty sure that in CR-XI, there is no automatic way to do this. I recommend skipping the cross-tab designer completely and just making your own:
Make a new CR using a placeholder table that has exactly 1 record.
In this CR, suppress everything but the details section. Add a new details section so you will have Da and Db.
In Da, add a subreport. Use your real datasource and add Column1 and Column2.
In Db, add a subreport. Use your real datasource and add Column3 and Column4.
I don't have time to test this, but I think it will display all the columns as you requested.
(Instead of step 1, you can probably use a placegrouper group in your report that only has 1 group. Then, when you add the subreports, make sure to not add any links to the main report.)
Edit
A dynamic number of columns makes this request much more difficult to do in Crystal.
Maybe you could autogenerate the entire report from a script. I couldn't help you with that, but I'm sure someone else on StackOverflow will.
You can use MS Excel to achieve something similar. Use MS Access or something similar to set up a crosstab of your data. Open a new Excel workbook and import your crosstabbed datasource using Data->Import External Data->Import Data (this imports the entire table, regardless of number of rows). In Page Setup, change settings to Fit to (blank) pages wide by 1 pages tall. You can format the data however you like and the format will be retained. This Excel method will squeeze all your columns into a 1-page wide area. It's not quite what you're asking for, but it will work.
The number of columns may be dynamic, but do you know what the field names could be? For example, your columns include 0-50 US States, then you know what the column names will be, just not which ones or how many. If this is your situation, then use my first suggestion (check off the suppress if blank options to hide unneeded subreports). It won't be pretty (alot of white space), but it can get the job done.
A possible solution can be a multi column report. But it can be difficult to make the row labels and values in the same line.
If you can create an additional row grouping then you have the solution that you want. For example if your columns have number like in your sample. Then you can add a formula like:
columnId \ 2