SSIS 2008 Lookup Transformation SQL Query loses formatting - ssis

Since the SQL query box of an SSIS Lookup transformation is almost unusable, I usually write my code in SSMS (formatted with Redgate's SQL Prompt tool) and copy it to the Lookup.
When you close this window and later come back in, sometimes the formatting is preserved, but sometimes the carriage returns are replaced by the "square" character, as if the editor doesn't know how to display a carriage return, making the SQL unreadable. Copying it back into SSMS renders it perfectly readable again, and copying it back to the Lookup usually restores the formatting.
Any idea why the SQL box sometimes can't display the carriage returns properly? Is there any way to fix it, or is it just an annoyance you have to live with in SSIS?

Have you tried clicking on the 'SqlCommand' edit button in the property grid (in the 'Custom Properties' section)? I find that the string value editor that pops up renders the CRLFs correctly even when the object's native (custom) form doesn't.
F4 is a useful shortcut to jump to the properties list for the selected object, if it's not already showing.

Just an annoyance you have to live with in SSIS. I've encountered the same problem over and over again in other screens and googling it resulted in nothing useful.

Related

SSRS report ignores grouping when downloading

I have created an SSRS report that allows expanding (+ sign) when rendered to a report accessible through a URL. Initially each group is collapsed when viewing the report.
However, when I download it as an MHTML format, it "loses" all the data that initially is hidden, only downloading the first line of data from each grouping.
Any ideas how to fix this? I'm comfortable working with expressions to achieve what is needed, I just need to know what to write in it. I'm guessing it needs to include some kind of "render" command, but not sure what to write.
Thank you.

Copy/paste results from Cube Browser in SSMS 2017

On my SSMS 2008 R2, whenever I browse a cube through SSAS, I can easily select all my results (Ctrl+A) and copy/paste it (Ctrl+C & Ctrl+V) into a Excel spreadsheet. As so (notice how all the content gets highlighted):
When I attempt the same thing with SSM 2017, none of this works. I researched the problem; however, it appears as though this functionality got removed. Or is it just me?
(I know that I can connect my Excel spreadsheet to my source and do all my manipulations there, but since I always work on SSMS, it's easier if I can keep using it without opening an Excel file. Especially, since I don't always need to do some comparisons with a spreadsheet).
This is one of of quirks of SSMS. The Browse Cube option does not allow you to copy the results.
BUT, there is a work-around. From your Browse Cube screen, click the 'Design Mode' to get the actual MDX query
Now, open a new MDX query editor Window
In this editor, paste you MDX query and execute it.
Now, you should be able to copy the results.

Overcoming Worksite dialog with VBA

All
I have a database which exports to a word document (via a report saved as an excel document). Essentially access exports the report, opens it and word, and then parses the data into a word table. There are a handful of reasons it's done this way, rather than just exporting the report directly to word, and it all works fine.
Until...
We have worksite / filesite integration, and so if you are not connected to the local network, worksite prompts you during word startup for the relevant document server, or ask if you want to operate offline, or operate locally. The problem I have is that because all of the word document creation isn't visible (and I'd prefer for it not to be), there's no way of answering this prompt.
We can resolve this by just saying "if you're not connected to the network, you need to open an instance of word before you try exporting." But that's annoying, and also people just forget, with the result that the export just hangs (there's no error to handle), and you have to manually end the word (and excel) processes though task manager.
Is there a way to e.g.,
Run a timer in parallel, which is set going just before the create.object("Word Application") line, and when it gets to a certain point (say 20 seconds) and the code hasn't advanced, then it just assumes something's gone wrong and makes word visible?
Or to detect the presence of the filesite dialog?
Or, ideally, just provide the input for the dialog programatically (i.e. "click" the Local button)(the user is prompted for an export location, which is always local)?

Odd behaviour in MS Access

Right now I'm working on an application in access 2010 that generates letters based of data taken from a share point site. The user inputs some parameters from some combo boxes on a form. After the selection is made the user selects the type of letter they want by pressing a button.
This works fine but I'm experiencing an odd issue when I close access and reopen it later.
When I open the form after starting access again I'll attempt to create a letter but instead of working like it did before the criteria prompt window appears asking for a parameter instead of taking the form values.
This happens every-time I restart access and the way I've been fixing it is by changing the names of the combo-boxes and then adjusting the queries accordingly.
This is what i was using to get the form values in the query
Like [Forms]![Main Menu]![A] & "*" (A is the name of the combo box, I got tired of renaming it)
Any Idea whats going on because I'm at a loss.
Thanks in advance!
If you are 100% positive that Access is finding your parameters just fine, and when Access closes they are lost, then:
Do you have any backup copies of this database before the error
occurred? Can you use one of them?
Do you Compact & Repair the database every time you close it? This
can be used somewhat as "damage control," because MS Access does
have a tendency to become corrupt.
Make sure the Main Menu form is open as long as the query is
running. Does it close right away (aka the query isn't finding the
parameter because the form is closed)?
From searching around, it seems that you aren't the only person with this problem. A known fix for people seems to have been copying all objects into a new database (which to me, sounds like the database is corrupt.) This could also mean maybe only your form is corrupt. Perhaps try to create a new form that does all of the same things that your Main Menu form does.
I'm sorry there doesn't seem to be a 'clear-cut' definitive solution for your situation.
If any VBA is involved, see below:
If you use the "Database Documenter" feature and check "yes" to all the options, you will obtain an exhaustive report that should let you trap your problem parameter. Export this report as an .rtf or .pdf document, so it is searchable. Identify a keyword from the dialog prompt, and search on that.
Once you check the query objects using the Documenter, check your VBA code. You'll do this by stepping through code in the IDE. If the main form has subforms, they are opened with (within) the main form. And they load before the main form.
Identify those subforms.
Sprinkle breakpoints in their code modules (if you find a Load function, that is highly relevant).
If the main form has a code module, do the same there.
From this thread

Is there a way to change the sql reporting chart type and sub type at runtime?

Is there a way to change SQL Reporting "chart type" and "sub type" at runtime?
I'm working with a .rdlc report and can't seem to figure out the way to change this at runtime. I don't have the "Expression" ability in either of these fields.
Looks like it may not be possible until 2008: Microsoft Link
Your .rdlc file is where everything is defined about your report, including report type. So in cases where I want to change something about the report, I just modify the rdlc file using my favorite xml editing method (XmlDocument, XPath, etc.). You would just modify your RDLC file on the fly to change the report type, then display, or save, whatever.
I did this to allow users to set their own report colors, for example, since those are defined in the rdlc as well.
I am trying to do this exact same thing. I have a set of measures that are shown and then a chart underneath that will show only one measure at a time, depending on user input (which of the measures they wish to see in chart form). However, certain measures are better as columns instead of lines, so I'd like to change the chart type at render-time.
My initial idea is to overlap two charts and set their visibility opposite of each other and according to the user dropdown input. Seems like there could be an easier way (if that idea would even work in the first place?)
Thanks.
I'm using 2008 and it is not solved there as far as I can see. There are so many options for chart type and then even more on subtype, I wouldn't want to have to render them all and then show or hide the right one.
I'm wondering if there is a way to parse the XML of the .rdlc and feed it back to the report viewer without having every user getting there own new modified version of the actual .rdlc file.
On a side note, MS just released a new charting package (from the acquisition of Dundas). Maybe I'll dump the report idea and go with the mschart server control.
One possible solution could be to generate both the charts you wanted and then hide one of them based on your requirement.
Think multiple Values and Visibility. If all other variables are constant (i.e., category, series, etc), simply add a Value for each of the desired chart type, and use a parameter to control value visibility. Elegant and simple.