Monday, January 24, 2011

SSRS tools

In addition to the Report Builder 3.0 tool from microsoft, there are also different ways to create RDL and RDLC reports:
http://msdn.microsoft.com/en-us/library/ms155792.aspx

Report builder provides a very quick report designer to play with your existing data.  It generates RDL and can be uploaded to the reporting server immediately.

Saturday, January 1, 2011

Passing Data from ViewModel to Javascript on the View

Option 1: construct the javascript into a string put it directly into the ViewData
ViewData["clientScript"] = "<script type='text/javascript'>initialize();addOverLay(-34.397, 150.644)</script>";

<%=ViewData["clientScript"]%>

This is of course prone to javascipt attacks

Option 2: Convert to Json(InfoList is of type string)

var js = new JavaScriptSerializer();
var listOfInfos = new List<string> {"abc", "cde"};

var viewModel = new InfoModel
               
{
                   
InfoList = js.Serialize(listOfInfos);
               
};
return View(viewModel);

In the View
   <script type="text/javascript">
      var result = <%= Model.InfoList%>
   </script>