Click here to Skip to main content
15,900,461 members
Home / Discussions / C#
   

C#

 
QuestionRegular expressions. Pin
Septimus Hedgehog31-Jul-13 3:06
Septimus Hedgehog31-Jul-13 3:06 
AnswerRe: Regular expressions. Pin
Pete O'Hanlon31-Jul-13 3:09
mvePete O'Hanlon31-Jul-13 3:09 
GeneralRe: Regular expressions. Pin
Septimus Hedgehog31-Jul-13 3:15
Septimus Hedgehog31-Jul-13 3:15 
QuestionTreeview in windows application Pin
Arun kumar Gautam31-Jul-13 0:26
Arun kumar Gautam31-Jul-13 0:26 
AnswerRe: Treeview in windows application Pin
Simon_Whale31-Jul-13 0:46
Simon_Whale31-Jul-13 0:46 
AnswerRe: Treeview in windows application Pin
Abhinav S31-Jul-13 1:12
Abhinav S31-Jul-13 1:12 
QuestionRe: Treeview in windows application Pin
Eddy Vluggen31-Jul-13 3:16
professionalEddy Vluggen31-Jul-13 3:16 
AnswerRe: Treeview in windows application Pin
Arun kumar Gautam31-Jul-13 3:19
Arun kumar Gautam31-Jul-13 3:19 
QuestionProblem with treeview in windows application Pin
Arun kumar Gautam31-Jul-13 0:25
Arun kumar Gautam31-Jul-13 0:25 
QuestionOO Design Pin
KeithF30-Jul-13 22:53
KeithF30-Jul-13 22:53 
QuestionRe: OO Design Pin
Eddy Vluggen31-Jul-13 8:36
professionalEddy Vluggen31-Jul-13 8:36 
AnswerRe: OO Design Pin
KeithF31-Jul-13 21:58
KeithF31-Jul-13 21:58 
Questionfilter interface Pin
Atul Kumar Singh230-Jul-13 19:44
Atul Kumar Singh230-Jul-13 19:44 
AnswerRe: filter interface Pin
Abhinav S30-Jul-13 19:53
Abhinav S30-Jul-13 19:53 
GeneralRe: filter interface Pin
Atul Kumar Singh21-Aug-13 6:35
Atul Kumar Singh21-Aug-13 6:35 
AnswerRe: filter interface Pin
Richard Andrew x641-Aug-13 11:22
professionalRichard Andrew x641-Aug-13 11:22 
QuestionGeneric Report Running Pin
eddieangel30-Jul-13 9:43
eddieangel30-Jul-13 9:43 
AnswerRe: Generic Report Running Pin
Mycroft Holmes30-Jul-13 12:40
professionalMycroft Holmes30-Jul-13 12:40 
GeneralRe: Generic Report Running Pin
eddieangel30-Jul-13 12:49
eddieangel30-Jul-13 12:49 
I have used Telerik a bit so I am not super unfamiliar with it. So that I am not sitting on my hands all day I decided to just switch() the report name parameter until I can figure out the anonymous access piece.

C#
private bool RunReport(string reportName, int? claimId, int? propertyId, int? ecrId)
        {
            switch (reportName)
            {
                case "COR - Cost Summary By Address":
                    Telerik.Reporting.Processing.ReportProcessor reportProcessor = new Telerik.Reporting.Processing.ReportProcessor();
                    System.Collections.Hashtable deviceInfo = new System.Collections.Hashtable();

                    Telerik.Reporting.InstanceReportSource instanceReportSource = new Telerik.Reporting.InstanceReportSource();
                    CostSummaryByAddress myReport = new CostSummaryByAddress(ecrId, claimId);
                    instanceReportSource.ReportDocument = myReport;
                    
                    Telerik.Reporting.Processing.RenderingResult result =
                        reportProcessor.RenderReport("PDF", instanceReportSource, deviceInfo);

                    string fileName = result.DocumentName + "." + result.Extension;
                    string path = System.IO.Path.GetTempPath();
                    string filePath = System.IO.Path.Combine(path, fileName);

                    using (System.IO.FileStream fs = new System.IO.FileStream(filePath, System.IO.FileMode.Create))
                    {
                        fs.Write(result.DocumentBytes, 0, result.DocumentBytes.Length);
                    }
                    break;
            }
            return true;
        }


And the report class:

C#
public partial class CostSummaryByAddress : Telerik.Reporting.Report
    {
        public CostSummaryByAddress(int? ecrId, int? claimId)
        {
            if (ecrId == null)
            {
                ecrId = 1;
            }
            InitializeComponent();
            using (litigatorProEntities _db = new litigatorProEntities())
            {
                var model = from d in _db.ECRDatas.Where(e => e.ecrId == ecrId)
                            select new CostSummaryViewModel
                            {
                                claimName = d.ECR.Claim.description,
                                property = d.property,
                                totalCost = d.totalCost
                            };
                this.DataSource = model.ToList();
            }

        }


Frankly, I have built all of these reports in Crystal so I am not sure I am going to stick with Telerik for reporting as all of the reporting is done on an application server with a note being emailed to the user. Since none of it is being displayed in a viewer I am thinking it is more work than it is worth. We will see, though.

Cheers, --EA
GeneralRe: Generic Report Running Pin
Mycroft Holmes30-Jul-13 14:20
professionalMycroft Holmes30-Jul-13 14:20 
QuestionHow to monitor and block a registry key change? Pin
turbosupramk330-Jul-13 8:07
turbosupramk330-Jul-13 8:07 
AnswerRe: How to monitor and block a registry key change? Pin
Dave Kreskowiak30-Jul-13 9:27
mveDave Kreskowiak30-Jul-13 9:27 
GeneralRe: How to monitor and block a registry key change? Pin
turbosupramk331-Jul-13 4:13
turbosupramk331-Jul-13 4:13 
GeneralRe: How to monitor and block a registry key change? Pin
Dave Kreskowiak31-Jul-13 5:58
mveDave Kreskowiak31-Jul-13 5:58 
GeneralRe: How to monitor and block a registry key change? Pin
Eddy Vluggen31-Jul-13 8:39
professionalEddy Vluggen31-Jul-13 8:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.