SSRS - Changing the reference of element expressions to reflect dataset rename automatically - reporting-services

I am using the SQL Server Report Builder, and just changed the name of a dataset. Is there a way to make all the already existing elements in the report that reference the old name, to use the new name?
Doing each one manually is a lot of work, so any tips would be appreciated!
To do each field manually, I would have to enter the expression and change
=First(Fields!FieldName.Value, "OldDataSetName")
to:
=First(Fields!FieldName.Value, "NewDataSetName")

Your report is just an XML file. Open it in notepad and replace all occurrences of old name to new.

Related

MS Access 2013 Using Expression Builder to only display the first 25 characters in a text field for a report

I use the MS Access 2013 Expression Builder regularly.
But one thing I've never managed is simply to show only the first (say 25) characters of of a text field on the report.
It would seem to be a no-brainer. I've done far more complex things in Expression Builder without an issue. But shortening a text field on a report always return #Type! no matter how I try to adjust the expression.
It would seem to me that all I need is:
=Left([CompanyName],25)
But it just doesn't work! The report shows a #Type! error.
I can do this no problem by creating a RecordSet SQL string and setting the report RecordSource to it (with OpenArgs). But I can't manage it in Expression Builder.
What am I doing wrong?
When you build expressions for a form, then ANY column that exists in the datasource can be used - EVEN if not placed on the form.
However, reports have a significant difference. Your expressions ONLY work against data bound controls. In other words, the control has to be on the report (no doubt in this case in the details section of the report.
What this means is you have to drop into the details section (and you can and should use in design mode - add existing fields:
So, you need to add the Company name field to the report.
Of course you don't want it to display, so you can delete the label part, and set the control visible part = false. Eg: this:
Remember, you can't have the control reference its self.
In your case, the control you dropped "most" likely is called CompanyName, and then you changing the datasource expression to its self!!!
The other way?
well, you need to RE-NAME your control!!!
If you JUST drop the control onto the report, then its name will be CompanyName.
But, you NOW using =left(CompanyName,25) which POINTS to its self!!!!
So, as noted, you can drop in a company name control and then set visible = false.
The other way, is to CHANGE the name of the control to be DIFFERENT then the company name.
So, you can use add fields, but then in the other tab, rename.
So, say I just dropped in a Description column, but want to use left(10) on it
So, we do this:
Note VERY careful how I re-named the control.
I can't use left(Description,10), since that would refer to the VERY SAME control that I am attempting to use the expression against!!!
I would be saying, please use left of a control called description, but that description s the expression I am wanting to execute against!!!!
So, re-name the control. And now I can do this:
Note the arrow in above - note VERY careful how the control name is DIFFERENT then the data expression (Description) in this example.
Note VERY careful, I can now place OTHER controls on the report, and reference now:
I can reference Description in the expression, OR I CAN USE DescripitonLEFT in that expression!!!!
As you can see, we need a way to distinguish which control we are referencing here. In fact, some developers i have known as a habit NEVER use the same name for their controls vs the datasource of the control for this reason.
In your case the very same expression, and very same control BOTH have the same name - and thus you can't evaluate the expression of a left(Descripiton,10) against the VERY same control with the VERY same name!!!
So, you have to dis-ambiguate the name and the expression you want. In this case CompanyName. As noted, your left("some control") is the VERY same name as your current control.
Try just re-name of the control you dropped into the report.

How to change the Field Label and format for the formuale field created in the step in dashboard in einstein analytic?

How to change the Field Label and format for the formuale field created in the step in dashboard in einstein analytic Salesforce.
Field formatting is controlled via the dataset's XMD. You can modify this JSON file, but the easier way is to use the interface. For created fields, the base dataset (or the first dataset loaded in SAQL) is used for reference the XMD file. Therefore, open that dataset in a new explore window, click on fields in the left panel, and add your created field name as a measure or dimension. Then click the added field and select the formatting.
See more about the XMD file here.
See more about customizing field formatting here.

Naming sheets in SSRS when imported to Excel

I have put page breaks in my SSRS report. When report imported to Excel, report is divided into different sheets according to page breaks. Is it possible somehow name those sheets? Thanks for assistance.
You can easily change the tab name by setting the "Page Name" field on the properties sheet of the group (in this example "Buyer") that is providing the page break.
You can't do that with standard SSRS, but I know you can do it with OfficeWriter by SoftArtisans.
It's a proprietary application which isn't cheap, but it let's you create a template in Excel which you can then export the report into. You can do stuff like create charts and pivot tables as well which get populated automatically.
We have used their product and it works well. Their app can also be used to generate other Office artifacts such as Word docs.
(BTW I have no affiliation with SoftArtisans)
But how can I Name each tab with different names?
As Randy pointed out, the PageName is used to name tabs when a report is exported to Excel. Normally you would use a field name for the PageName expression.
If your page breaks are due to a Group, you would probably want to use the name of the group as the PageName. For instance, if you had a report of sales by customer with a separate tab for each customer, you would probably want to use the customer name field as the PageName expression.
=Fields!Customer_Name.Value
If you add the left(buyer,5) etc..into your dataset, put this as the initial group in your report then (page break between each instance of a group) and also use this field as the page name..should do the trick
Navigate to the tablix properties. Type the "SheetName" you need under "PageName" expression. It is better to assign this property from a Global variable, but if you need a custom set name for each of your Excel tabs, this is the way.

SSIS multiline string variables , in VS 2008

I need to store a large query into a string variable.
When I paste the sql query into the Value property of the variable, I see only one line.
I am using VS 2008 , BIDS to design the package.
I think this is a bug as stated here,
what I am actualy intersted is a workaround to bypass this.
We use a parameters table in a SQL database, then load long strings into variables using a simple SQL query. This has the additional advantage that you can refactor the query code without opening SSIS.
It also allows multiple packages to easily share common query code.
Edit: Of course, if you only want to do this once...
Manually edit the XML. Put a placeholder value in the variable, then open the .dtsx in a text editor, locate the placeholder value, and replace it with the value you need.
Please back up your package prior to doing this.
Another work around - you can set the EvaluateAsExpression to True and put the SQL query in the Expression. The Expression will have a ... button which you can click to edit a multi-line value.

Microsoft Access 2003 - Expression Builder

When the user click the add button on the form, everything else is saved except for the field that uses expression builder in its control source. I understand the control source is the main source of saving the field into the table. How do i (or can i?) actually save the field into the record source?
This goes by design - you cannot use an expression as the control source and then expect Access to write to a database column that is nowhere specified.
You could use an expression for the control's default but for being able to write to a dateabase column you need to make the column the control's source.
Another possibility is using the form's "Current" event to fill the field with the expression's result.