T-SQL Notification - Use HTML to create Chart/Graph - html

Is it possible to use xml and html to create a chart or graph to include in an email notification from MSSQL Server?
Has anyone done this before? Any suggestions?
For example: A chart visually representing the amount of receiving hours required in the warehouse for the next couple weeks.

It can be tedious but this method works:
Export the data from T-SQL (probably as a JSON) or directly use the database from .Net application.
Now create a word template with some graphs (Line/Bar/Pie Chart or whatever) and bookmark it with some name 'my_chart'
Now include Microsoft.Office.Interop.Word & Microsoft.Office.Interop.Excel references in your C# project. (Google it & see this also)
Now in your C# project access those Graphs in word file using bookmark name & populate it with Data from database. (See this)
It may take some time but if your requirement is worth it you can do this.
Also you don't need to study C#(it's very similar to Java) for this, just see interop C# syntax as you keep going BUT if you want see C# documentation for any reference.
Refer this tutorial also.

Related

How to add manage temparory data in DotnetNuke?

I am beginner in DNN. I am creating a module which provides Login, Dashboard and Add-Update Form. I have data in JSON format. I want to store it temparory while user use the website. Data will be destroy as soon as user will close the website.
Currently I have created a folder in my Solution Explorer of project in Visual Basic and created 3 .json files which stores login_info.json, basic_info.json and auth_info.json. I write json data whenever user login and I make it blank when user logout.
Above method is working fine now but I afraid it will work when I will publish this module.
Also I may have situation where I need to store image some where. I don't know how I will manage.
Can anybody please guide me?
Is this proper way to store data temparory in DNN?
Is there any other better way?
After getting one of reply for Database Suggestion
Is there any table which same as User Meta in DotnetNuke?
You use the ConnectionString that is used by DNN and access the database as you would normally.
DotNetNuke.Common.Utilities.Config.GetConnectionString()
Or you can use the Data Access Layer that the DNN Framework supplies. For that take the Christoc Templates. In there is all you need to communicate with the DB.

How can I get JSON data out of a web page and parse it in Excel VBA

My company has a web service that we use to keep track of some information. They have built an API that allows us to get information out of it. My group is trying to do the same. However, the other groups have all used C# to accomplish this, and the development level of this team isn't higher than that of Excel VBA. What I need to do:
Go to a known URL http://service.company.com/Group=1
Get the JSON result that appears on the screen into VBA
Translate the JSON to readable human - This part seems to have been solved here
The rest of the code around what I need to do, I can handle. I'm hoping there is a JSON reader built into VBA that I can leverage for part 3. Any help would be much appreciated.
EDIT:
I figured out how to get JSON information out of the web page, there was some user/password authentication required in order to get that. So that is part 1 and 2 done. I'm working on Part 3. The JSON information seems to be coming out in this pattern:
[{"Column1":value1,"Column2":value2},
{"Column1":value1,"Column2":value2}]

How to merge multiple cucumber results into a single report?

I have a strong test suit built using Cucumber - WATIR. Also I am using pretty face reports to generate test execution report which gives a crispy dashboard. Along with that I also do create HTML and json reports too.
I set up all the reports to be generated in a folder with the day, and browser name. so today it would be like 11-15/IE9/ and 11-15/FIREFOX/ etc. So I need a way to prepare a report where I should get a report which should be a merge of all the reports. Any suggestion how to achieve will be highly appreciated.
How can I do this with generated json or html reports?
Also a thought in my mind is , any how I am having pretty face report, where I am getting a dashboard with name index.html inside 11-15/IE9/ and 11-15/FIREFOX/, I want to create a dynamic HTML page where it reads all the datefiles/browser creates links to the index.html on it.
Awaiting any new idea or any enhancement to my existing idea.

Can we write a function in SSRS globally

Im currently using SSRS-2008R2. I've an scenario where i have to maintain the External image as a logo for each reports we have. Not, only that, we have our custom date formats that what we should change according to the Date Type users define in an asp.net application.
There are lot of things we have to do on every report. Thats my problem.
Following is the one of them Im currently sharing as example :
Currently i maintain the following function for each reports i've:
Public Function GetLogoImage() As String
Dim ImageLogoURL As String
if Globals!ReportServerUrl is nothing then
ImageLogoURL = "http://localhost/ReportServer" + "?%2fImages%2fLogo"
else
ImageLogoURL = Globals!ReportServerUrl + "?%2fImages%2fLogo"
Return ImageLogoURL
End Function
I hope, i asked question clearly. Im newbie in SO.
Thank you in advance.
If you have a list of functions that you wish to apply to multiple reports and you're not willing to copy them to every single one of them, you can create an external library and then add it as a reference to every report.
This is quite simple to do and there's lot of documentation around the web.You can start here. You will, however, have to maintain this external library but if you have a lot of code, I personally think this is a much better solution.
If you want to have a predefined layout, you may want to consider having a master report and then include other reports as sub-report objects, but you'll lose some flexibility design wise.
Since the accepted answer is more of a comment and the link provided is broken, i'll provide my answer for people who might need a quick guide on how to use custom code in ssrs:
In Design view, right-click the design surface outside the border of the report and click Report Properties.
Click Code.
In Custom code, type the code. Errors in the code produce warnings when the report runs.
Once you press ok, to call the function that you saved you just need to right click on a cell, select "Expression" and paste in the following string: Code.GetLogoImage
More detailed source here.

fluent nhibernate + how to create sql schema

I have a question about how to render the sql schema with fluent nhibernate.
I have searched alot and used a couple of things but i dont know how to render it. I´m only building the ground of my website, the core. And now i want to create the database from my mappings. How do i do that? Is it with testrunning or what?
If i build the solution i don´t get any sql file i have also tried export it to hbm files to use schema tool export but dont get it to work.
have tried
Fluent NHibernate (1.2.0.712) export mappings to HBM not working / not respecting conventions
and
https://stackoverflow.com/questions/5244257/build-schema-with-fluent-nhibernate
and alot other links.
What do i have to do to get the sql file? every site give almost the same code but they don´t tell how to render it. How to execute the process to retrieve the file..
can anyone tell me? i can build it by my self but i want to try this function!
best regards
You can create the database using the SchemaExport.Create method:
// this NHibernate tool takes a configuration (with mapping info)
// and exports a database schema from it
new SchemaExport(config)
.Create(true, true);
If you want to see the generated SQL, you can use the ShowSql method, but this is not required to create the database.
_sessionFactory = Fluently.Configure()
.Database(SQLiteConfiguration.Standard
.UsingFile(SqliteDatabaseFullPath())
// Display generated SQL in Output window
.ShowSql()
)
...
It's been my experience with NHibernate that it's almost always best to start with a working example, so I suggest you get the FirstAutomappedProject sample project that is part of the FNH source. This will give you all the pieces you need.
Probably easiest to download the zip file (button on the upper left) which includes all the FNH source code, and look in the "src" folder for the examples.