Pass Report Data Within a URL for SSRS reports - sql-server

We have a .Net Core web application, where some data is generated dynamically(Some mathematical calculations) and displayed on the screen.
When the user clicks "Print", we need to convert all the data displayed into a PDF.
Currently, we are storing the data in a DB and sending the PrimaryKey as a parameter to the SSRS report in the URL. And then SSRS calls another REST API to access that data.
Like described here - Pass a Report Parameter Within a URL
Is there any possibility for us to skip the Storing data in DB and directly pass the dataset to the SSRS server in a URL, and generate a PDF?

Unfortunately, you can send only get variable to the reporting. And you can't send a lot of data because get variable has a restriction. If you have a lot of information save it in the DB and print is the best way, if not you can put the big string in get variable and parse in in the reporting

Related

Azure Logic App - Write Salesforce records to a blob

I am new to azure logic app and am trying to develop our first logic app in the designer. The goal is simple - connect to our salesforce production instance and extract data from an object. Write that data to a delimited file in our storage container - from where the data warehouse can ingest the file.
The first steps are pretty straight forward - i added a recurrence trigger and connected a salesforce Get Records action to it. Chose the User object in salesforce for now because its got minimal data.
Executed the logic app and it runs fine. I can see the data extracted is correct.
However now I am lost as to how to create a delimited file in the container. I obviously could not connect the Create Blob action directly to the Get Records action. Based on some documentation i tried creating a CSV table first but got an error saying that an Array is expected but the Get Records action returns an object.
If anyone has faced something similar and has any pointers, documentation would appreciate it. Thanks in advance for any help
Regards
Sid
The Get records object will have 2 objects '#odata.context' and 'value'. The 'value' field will have actual array of records, so you need to use the value.
Please refer below screenshot of the logic app that works, fetched record from user object and stored as delimited csv file.
Here is output screenshot for create csv table:

Design Query - Pull data from a third party data source and show it on UI

We have to design a system where we have an application which will show data. The source of data is a third party Db which exposes apis to fetch data out of it. We have our db - Sql server where we will store this data. From the UI of the application , whenever we want , we can pull this data from this third party tool by a button click. Question is - whenever there is a button click to pull data, should the data from this third party tool first go and store in our Sql db and then we should fetch this onto our UI. Or data should be fetched directly onto UI first , instead of storing in DB first and then later on Save button click this should get stored in our DB.
Think about the following points
Do you have permissions to copy this data in your database ?
Do you even want to keep a copy of this data in your database ? (because the original might have changed from your copy, etc.)
Can you afford to not have this data surfacing in your app when (and if) the 3rd party database is down ?
Are you getting a performance advantage if you copy the data in your app's db ?

How to save data in a separate database

I'm new here. I am currently enrolled in a Data Analytics degree program. I looked through the past questions but I could not find an answer to my question.
Here is my question. Let's say you have a plain and simple HTML form on a webpage. Each field is connected to a certain column on the database, correct? Like your first name and last name.
What if someone wanted to store the username and password on it's own separate database on a completely different server. How does the software know to send those form fields to a completely different database? Does it work off of IP? I'm really confused as to how this is accomplished.
This is a very high-level summary of what happens but hopefully it makes sense.
When the user submits the form, the form data on the HTML page is sent to the web server through an HTTP request. The web application then processes this request and typically uses a connection string (which includes information about the database) to connect to the database and update the database appropriately. Each field in the form does not have to be directly associated with a field in the database. For example, the application may be coded so that multiple fields are concatenated into one database column. The connection string can use either hostname or IP address, but hostname is typically used as it is more human readable.
When one wants the application to send data to a different database, they can just modify the connection string. This is typically done during web app development when switching environments. For example, in the attached diagram, if I wanted to use the production database instead of the test database I could modify the connection string within the web application so that it is pointed to the production database by simply changing the hostname in the connection string.

Is it better to process auto-complete/suggestions on the client or server?

I am building a web app that will use an auto-complete/suggestions for the end user as they type their information in. This will be specifically for entering Country, Province, City information.
Do a wild card search on the database on each keystroke:
SELECT CityName
FROM City
WHERE CityName LIKE '%#CityName%'
Return a list of all Cities to a given Province to the client and have the client do the matching:
SELECT CityName
FROM City
WHERE ProvinceID = #ProvinceID
These would be returned to the client as a JSON string via an ajax call to a web service. My thoughts are that javascript would be able to handle the list of 100+ entries via JSON faster than the database would be able to do a wildcard search, but I'd like the communities input.
In the past, I have used both techniques. If you are talking about 100 or so entries, and assuming each entry is very small, it will likely be faster to do the autocomplete filter on the client side. That will provide you with better response time (although probably negligible) and will reduce the load on your server.
Google actually does a live search while the user is typing, and it seems to be pretty responsive from the user's point of view. This is an example where the query must be executed server-side because the dataset is far too large to transfer to the client.
One thing you might do is wait until the user types two keystrokes before fetching the list from the server, thus narrowing down the results initially. Of course, that adds complexity - you would then need to refresh the list if the user changes either of the first two keystrokes.
We have implemented same functionality using ajax auto complete control we wait the user type three keystroke before fetching the list from server we have not done any coding at client side we just assigned web services method which return list to ajax control and its start working
In the end user's interest, it is always better to handle this client-side.
The Telerik Autocomplete controller allows for both ways.
Of course under load client-side autocomplete is likely to make the application crawl.

How to I access reports programmatically in SalesForce using Apex

I'm trying to write an app on the SalesForce platform that can pull a list of contacts from a report and send them to a web service (say to send them an email or SMS)
The only way I can seem to find to do this is to add the report results to a newly created campaign, and then access that campaign. This seems like the long way around.
Every post I read online says you can't access the reports through Apex, however most or all of these posts were written before Version 20 of the API was released last month, which introduced a new report object. I can now programmatically access info about a report (Such as the date last run etc) but I still can't seem to find a way to access the result data contained in that report.
Does anyone know if there's a way to do that?
After much research into it, I've discovered the only way to do this at the moment is indeed to scrape the CSV document. I would guess that Conga etc are using exactly this method.
We've been doing this for a while now, and it works. The only caveats are:
Salesforce username / password /
security token has to be shared to
the app connecting. If the password
changes (and by default it is changed
every 30 days or so) the token also
changes and must be re-entered.
You have to know the host of the account, which can be difficult to
get right. For instance while most european accounts would use emea.salesforce.com to access CSV, our account uses na7 (North America 7) even though we're located in
ireland. I'm currently sending the page host to the app and parsing it
to calculate the correct subdomain to use, but I think there has to be a
better way to do this.
Salesforce really needs to sort this out by supplying an API call which allows custom report results to be exported on the fly and allowing us to use OAuth to connect to it. But of course, this is unlikely to happen.
In the SalesforceSpring 11 update, it seems you can obtain more informations about the Reports:
As stated in the API for Report and ReportType, you can access via Apex the fields used in the query by the Report, reading the field "columns", as well as the field used to represent the filters called "filter".
Iterating through this objects, should allow you to build a String representing the same query of the Report. After building that string you can make a dynamic query with a Database.query(..) call.
It seems to be a little messy, but should work.. (NOT TESTED YET!)
As header states, this works only with Custom Reports!
Just to clarify for fellow rookies who will find this, when the question was asked you could access your report data programatically, but you had to use some hacky, error prone methods.
This is all fixed, you can now access your reports via the API as of Winter '14.
Documentation here - http://www.salesforce.com/us/developer/docs/api_analytics/index.htm
Go to town on those custom dashboards etc. Cross posted from the Salesforce Stack Exchange - https://salesforce.stackexchange.com/questions/337/can-report-data-be-accessed-programatically/
But Conga (appextremes) do this in their QuickMerge product, where the user specifies the report Id, and the apex script on the page runs the report to extract the results for a mail merge operation.
the v20.0 API added metadata about the reports, but no way to actually run the report and obtain the results. If this is a standard report, or a report you've defined, you can work out the equivalent SOQL query for your report and run that, but if its an end user defined report, there's no way to do this.

Resources