├── .gitattributes ├── .gitignore ├── CrystalReportWebAPI.sln └── CrystalReportWebAPI ├── App_Start ├── BundleConfig.cs ├── FilterConfig.cs ├── RouteConfig.cs ├── SwaggerConfig.cs └── WebApiConfig.cs ├── Areas └── HelpPage │ ├── ApiDescriptionExtensions.cs │ ├── App_Start │ └── HelpPageConfig.cs │ ├── Controllers │ └── HelpController.cs │ ├── HelpPage.css │ ├── HelpPageAreaRegistration.cs │ ├── HelpPageConfigurationExtensions.cs │ ├── ModelDescriptions │ ├── CollectionModelDescription.cs │ ├── ComplexTypeModelDescription.cs │ ├── DictionaryModelDescription.cs │ ├── EnumTypeModelDescription.cs │ ├── EnumValueDescription.cs │ ├── IModelDocumentationProvider.cs │ ├── KeyValuePairModelDescription.cs │ ├── ModelDescription.cs │ ├── ModelDescriptionGenerator.cs │ ├── ModelNameAttribute.cs │ ├── ModelNameHelper.cs │ ├── ParameterAnnotation.cs │ ├── ParameterDescription.cs │ └── SimpleTypeModelDescription.cs │ ├── Models │ └── HelpPageApiModel.cs │ ├── SampleGeneration │ ├── HelpPageSampleGenerator.cs │ ├── HelpPageSampleKey.cs │ ├── ImageSample.cs │ ├── InvalidSample.cs │ ├── ObjectGenerator.cs │ ├── SampleDirection.cs │ └── TextSample.cs │ ├── Views │ ├── Help │ │ ├── Api.cshtml │ │ ├── DisplayTemplates │ │ │ ├── ApiGroup.cshtml │ │ │ ├── CollectionModelDescription.cshtml │ │ │ ├── ComplexTypeModelDescription.cshtml │ │ │ ├── DictionaryModelDescription.cshtml │ │ │ ├── EnumTypeModelDescription.cshtml │ │ │ ├── HelpPageApiModel.cshtml │ │ │ ├── ImageSample.cshtml │ │ │ ├── InvalidSample.cshtml │ │ │ ├── KeyValuePairModelDescription.cshtml │ │ │ ├── ModelDescriptionLink.cshtml │ │ │ ├── Parameters.cshtml │ │ │ ├── Samples.cshtml │ │ │ ├── SimpleTypeModelDescription.cshtml │ │ │ └── TextSample.cshtml │ │ ├── Index.cshtml │ │ └── ResourceModel.cshtml │ ├── Shared │ │ └── _Layout.cshtml │ ├── Web.config │ └── _ViewStart.cshtml │ └── XmlDocumentationProvider.cs ├── Content ├── Site.css ├── bootstrap-theme.css ├── bootstrap-theme.css.map ├── bootstrap-theme.min.css ├── bootstrap-theme.min.css.map ├── bootstrap.css ├── bootstrap.css.map ├── bootstrap.min.css └── bootstrap.min.css.map ├── Controllers ├── HomeController.cs └── ReportsController.cs ├── CrystalReportWebAPI.csproj ├── Global.asax ├── Global.asax.cs ├── Models └── LoginData.cs ├── Properties ├── AssemblyInfo.cs └── ServiceDependencies │ └── CrystalReportWebAPI - Web Deploy │ └── profile.arm.json ├── Reports ├── Demonstration │ ├── ComparativeIncomeStatement.cs │ ├── ComparativeIncomeStatement.rpt │ ├── OrderProcessingEfficiencyDashboard.cs │ ├── OrderProcessingEfficiencyDashboard.rpt │ ├── WorldSalesReport.cs │ └── WorldSalesReport.rpt ├── Financial │ ├── ConsolidatedIncomeStatement.cs │ ├── ConsolidatedIncomeStatement.rpt │ ├── IncomeStatement.cs │ ├── IncomeStatement.rpt │ ├── MonthlyVarianceCrossTab.cs │ ├── MonthlyVarianceCrossTab.rpt │ ├── RollingQuarterIncomeStatement.cs │ ├── RollingQuarterIncomeStatement.rpt │ ├── SortedVarianceAnalysisReport.cs │ ├── SortedVarianceAnalysisReport.rpt │ ├── TrialBalance.cs │ ├── TrialBalance.rpt │ ├── VarianceAnalysisReport.cs │ ├── VarianceAnalysisReport.rpt │ ├── YTDVarianceCrossTab.cs │ └── YTDVarianceCrossTab.rpt ├── ReportData │ ├── balance_sheet1.xsd │ ├── balance_sheet2.xml │ ├── customer.xml │ ├── customer.xsd │ ├── customer.xsx │ ├── orders detail.xml │ ├── orders detail.xsd │ ├── orders.xsd │ ├── orders2.xml │ ├── product type.xml │ ├── product type.xsd │ ├── product.xml │ ├── product.xsd │ ├── variance_xtab.xsd │ └── variance_xtab2.xml └── VersatileandPrecise │ ├── CollegeBoardPSAT9.cs │ ├── CollegeBoardPSAT9.rpt │ ├── FortifyFinancialAllinOneRetirementSavings.cs │ ├── FortifyFinancialAllinOneRetirementSavings.rpt │ ├── Invoice.cs │ ├── Invoice.rpt │ ├── chequereport.cs │ ├── chequereport.rpt │ ├── dunning.cs │ ├── dunning.rpt │ ├── invoiceshippingsimple.cs │ ├── invoiceshippingsimple.rpt │ ├── projecttimesheet.cs │ ├── projecttimesheet.rpt │ └── screenshots.pptx ├── Scripts ├── bootstrap.js ├── bootstrap.min.js ├── jquery-3.4.1.intellisense.js ├── jquery-3.4.1.js ├── jquery-3.4.1.min.js ├── jquery-3.4.1.min.map ├── jquery-3.4.1.slim.js ├── jquery-3.4.1.slim.min.js ├── jquery-3.4.1.slim.min.map └── modernizr-2.8.3.js ├── Utilities ├── ClientCacheWithEtagAttribute.cs └── CrystalReport.cs ├── Views ├── Home │ └── Index.cshtml ├── Shared │ ├── Error.cshtml │ └── _Layout.cshtml ├── Web.config └── _ViewStart.cshtml ├── Web.Debug.config ├── Web.Release.config ├── Web.config ├── favicon.ico ├── fonts ├── glyphicons-halflings-regular.eot ├── glyphicons-halflings-regular.svg ├── glyphicons-halflings-regular.ttf ├── glyphicons-halflings-regular.woff └── glyphicons-halflings-regular.woff2 └── packages.config /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Ww][Ii][Nn]32/ 27 | [Aa][Rr][Mm]/ 28 | [Aa][Rr][Mm]64/ 29 | bld/ 30 | [Bb]in/ 31 | [Oo]bj/ 32 | [Oo]ut/ 33 | [Ll]og/ 34 | [Ll]ogs/ 35 | 36 | # Visual Studio 2015/2017 cache/options directory 37 | .vs/ 38 | # Uncomment if you have tasks that create the project's static files in wwwroot 39 | #wwwroot/ 40 | 41 | # Visual Studio 2017 auto generated files 42 | Generated\ Files/ 43 | 44 | # MSTest test Results 45 | [Tt]est[Rr]esult*/ 46 | [Bb]uild[Ll]og.* 47 | 48 | # NUnit 49 | *.VisualState.xml 50 | TestResult.xml 51 | nunit-*.xml 52 | 53 | # Build Results of an ATL Project 54 | [Dd]ebugPS/ 55 | [Rr]eleasePS/ 56 | dlldata.c 57 | 58 | # Benchmark Results 59 | BenchmarkDotNet.Artifacts/ 60 | 61 | # .NET Core 62 | project.lock.json 63 | project.fragment.lock.json 64 | artifacts/ 65 | 66 | # ASP.NET Scaffolding 67 | ScaffoldingReadMe.txt 68 | 69 | # StyleCop 70 | StyleCopReport.xml 71 | 72 | # Files built by Visual Studio 73 | *_i.c 74 | *_p.c 75 | *_h.h 76 | *.ilk 77 | *.meta 78 | *.obj 79 | *.iobj 80 | *.pch 81 | *.pdb 82 | *.ipdb 83 | *.pgc 84 | *.pgd 85 | *.rsp 86 | *.sbr 87 | *.tlb 88 | *.tli 89 | *.tlh 90 | *.tmp 91 | *.tmp_proj 92 | *_wpftmp.csproj 93 | *.log 94 | *.vspscc 95 | *.vssscc 96 | .builds 97 | *.pidb 98 | *.svclog 99 | *.scc 100 | 101 | # Chutzpah Test files 102 | _Chutzpah* 103 | 104 | # Visual C++ cache files 105 | ipch/ 106 | *.aps 107 | *.ncb 108 | *.opendb 109 | *.opensdf 110 | *.sdf 111 | *.cachefile 112 | *.VC.db 113 | *.VC.VC.opendb 114 | 115 | # Visual Studio profiler 116 | *.psess 117 | *.vsp 118 | *.vspx 119 | *.sap 120 | 121 | # Visual Studio Trace Files 122 | *.e2e 123 | 124 | # TFS 2012 Local Workspace 125 | $tf/ 126 | 127 | # Guidance Automation Toolkit 128 | *.gpState 129 | 130 | # ReSharper is a .NET coding add-in 131 | _ReSharper*/ 132 | *.[Rr]e[Ss]harper 133 | *.DotSettings.user 134 | 135 | # TeamCity is a build add-in 136 | _TeamCity* 137 | 138 | # DotCover is a Code Coverage Tool 139 | *.dotCover 140 | 141 | # AxoCover is a Code Coverage Tool 142 | .axoCover/* 143 | !.axoCover/settings.json 144 | 145 | # Coverlet is a free, cross platform Code Coverage Tool 146 | coverage*.json 147 | coverage*.xml 148 | coverage*.info 149 | 150 | # Visual Studio code coverage results 151 | *.coverage 152 | *.coveragexml 153 | 154 | # NCrunch 155 | _NCrunch_* 156 | .*crunch*.local.xml 157 | nCrunchTemp_* 158 | 159 | # MightyMoose 160 | *.mm.* 161 | AutoTest.Net/ 162 | 163 | # Web workbench (sass) 164 | .sass-cache/ 165 | 166 | # Installshield output folder 167 | [Ee]xpress/ 168 | 169 | # DocProject is a documentation generator add-in 170 | DocProject/buildhelp/ 171 | DocProject/Help/*.HxT 172 | DocProject/Help/*.HxC 173 | DocProject/Help/*.hhc 174 | DocProject/Help/*.hhk 175 | DocProject/Help/*.hhp 176 | DocProject/Help/Html2 177 | DocProject/Help/html 178 | 179 | # Click-Once directory 180 | publish/ 181 | 182 | # Publish Web Output 183 | *.[Pp]ublish.xml 184 | *.azurePubxml 185 | # Note: Comment the next line if you want to checkin your web deploy settings, 186 | # but database connection strings (with potential passwords) will be unencrypted 187 | *.pubxml 188 | *.publishproj 189 | 190 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 191 | # checkin your Azure Web App publish settings, but sensitive information contained 192 | # in these scripts will be unencrypted 193 | PublishScripts/ 194 | 195 | # NuGet Packages 196 | *.nupkg 197 | # NuGet Symbol Packages 198 | *.snupkg 199 | # The packages folder can be ignored because of Package Restore 200 | **/[Pp]ackages/* 201 | # except build/, which is used as an MSBuild target. 202 | !**/[Pp]ackages/build/ 203 | # Uncomment if necessary however generally it will be regenerated when needed 204 | #!**/[Pp]ackages/repositories.config 205 | # NuGet v3's project.json files produces more ignorable files 206 | *.nuget.props 207 | *.nuget.targets 208 | 209 | # Microsoft Azure Build Output 210 | csx/ 211 | *.build.csdef 212 | 213 | # Microsoft Azure Emulator 214 | ecf/ 215 | rcf/ 216 | 217 | # Windows Store app package directories and files 218 | AppPackages/ 219 | BundleArtifacts/ 220 | Package.StoreAssociation.xml 221 | _pkginfo.txt 222 | *.appx 223 | *.appxbundle 224 | *.appxupload 225 | 226 | # Visual Studio cache files 227 | # files ending in .cache can be ignored 228 | *.[Cc]ache 229 | # but keep track of directories ending in .cache 230 | !?*.[Cc]ache/ 231 | 232 | # Others 233 | ClientBin/ 234 | ~$* 235 | *~ 236 | *.dbmdl 237 | *.dbproj.schemaview 238 | *.jfm 239 | *.pfx 240 | *.publishsettings 241 | orleans.codegen.cs 242 | 243 | # Including strong name files can present a security risk 244 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 245 | #*.snk 246 | 247 | # Since there are multiple workflows, uncomment next line to ignore bower_components 248 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 249 | #bower_components/ 250 | 251 | # RIA/Silverlight projects 252 | Generated_Code/ 253 | 254 | # Backup & report files from converting an old project file 255 | # to a newer Visual Studio version. Backup files are not needed, 256 | # because we have git ;-) 257 | _UpgradeReport_Files/ 258 | Backup*/ 259 | UpgradeLog*.XML 260 | UpgradeLog*.htm 261 | ServiceFabricBackup/ 262 | *.rptproj.bak 263 | 264 | # SQL Server files 265 | *.mdf 266 | *.ldf 267 | *.ndf 268 | 269 | # Business Intelligence projects 270 | *.rdl.data 271 | *.bim.layout 272 | *.bim_*.settings 273 | *.rptproj.rsuser 274 | *- [Bb]ackup.rdl 275 | *- [Bb]ackup ([0-9]).rdl 276 | *- [Bb]ackup ([0-9][0-9]).rdl 277 | 278 | # Microsoft Fakes 279 | FakesAssemblies/ 280 | 281 | # GhostDoc plugin setting file 282 | *.GhostDoc.xml 283 | 284 | # Node.js Tools for Visual Studio 285 | .ntvs_analysis.dat 286 | node_modules/ 287 | 288 | # Visual Studio 6 build log 289 | *.plg 290 | 291 | # Visual Studio 6 workspace options file 292 | *.opt 293 | 294 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 295 | *.vbw 296 | 297 | # Visual Studio LightSwitch build output 298 | **/*.HTMLClient/GeneratedArtifacts 299 | **/*.DesktopClient/GeneratedArtifacts 300 | **/*.DesktopClient/ModelManifest.xml 301 | **/*.Server/GeneratedArtifacts 302 | **/*.Server/ModelManifest.xml 303 | _Pvt_Extensions 304 | 305 | # Paket dependency manager 306 | .paket/paket.exe 307 | paket-files/ 308 | 309 | # FAKE - F# Make 310 | .fake/ 311 | 312 | # CodeRush personal settings 313 | .cr/personal 314 | 315 | # Python Tools for Visual Studio (PTVS) 316 | __pycache__/ 317 | *.pyc 318 | 319 | # Cake - Uncomment if you are using it 320 | # tools/** 321 | # !tools/packages.config 322 | 323 | # Tabs Studio 324 | *.tss 325 | 326 | # Telerik's JustMock configuration file 327 | *.jmconfig 328 | 329 | # BizTalk build output 330 | *.btp.cs 331 | *.btm.cs 332 | *.odx.cs 333 | *.xsd.cs 334 | 335 | # OpenCover UI analysis results 336 | OpenCover/ 337 | 338 | # Azure Stream Analytics local run output 339 | ASALocalRun/ 340 | 341 | # MSBuild Binary and Structured Log 342 | *.binlog 343 | 344 | # NVidia Nsight GPU debugger configuration file 345 | *.nvuser 346 | 347 | # MFractors (Xamarin productivity tool) working folder 348 | .mfractor/ 349 | 350 | # Local History for Visual Studio 351 | .localhistory/ 352 | 353 | # BeatPulse healthcheck temp database 354 | healthchecksdb 355 | 356 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 357 | MigrationBackup/ 358 | 359 | # Ionide (cross platform F# VS Code tools) working folder 360 | .ionide/ 361 | 362 | # Fody - auto-generated XML schema 363 | FodyWeavers.xsd -------------------------------------------------------------------------------- /CrystalReportWebAPI.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.31424.327 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CrystalReportWebAPI", "CrystalReportWebAPI\CrystalReportWebAPI.csproj", "{F5D614A7-C23D-4B38-8012-C55AE2CB1D86}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {F5D614A7-C23D-4B38-8012-C55AE2CB1D86}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {F5D614A7-C23D-4B38-8012-C55AE2CB1D86}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {F5D614A7-C23D-4B38-8012-C55AE2CB1D86}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {F5D614A7-C23D-4B38-8012-C55AE2CB1D86}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {0BE27A9D-4FE1-426C-85F7-30BA7B93C9F5} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /CrystalReportWebAPI/App_Start/BundleConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web.Optimization; 2 | 3 | namespace CrystalReportWebAPI 4 | { 5 | public class BundleConfig 6 | { 7 | // For more information on bundling, visit https://go.microsoft.com/fwlink/?LinkId=301862 8 | public static void RegisterBundles(BundleCollection bundles) 9 | { 10 | bundles.Add(new ScriptBundle("~/bundles/jquery").Include( 11 | "~/Scripts/jquery-{version}.js")); 12 | 13 | // Use the development version of Modernizr to develop with and learn from. Then, when you're 14 | // ready for production, use the build tool at https://modernizr.com to pick only the tests you need. 15 | bundles.Add(new ScriptBundle("~/bundles/modernizr").Include( 16 | "~/Scripts/modernizr-*")); 17 | 18 | bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include( 19 | "~/Scripts/bootstrap.js")); 20 | 21 | bundles.Add(new StyleBundle("~/Content/css").Include( 22 | "~/Content/bootstrap.css", 23 | "~/Content/site.css")); 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /CrystalReportWebAPI/App_Start/FilterConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web.Mvc; 2 | 3 | namespace CrystalReportWebAPI 4 | { 5 | public class FilterConfig 6 | { 7 | public static void RegisterGlobalFilters(GlobalFilterCollection filters) 8 | { 9 | filters.Add(new HandleErrorAttribute()); 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /CrystalReportWebAPI/App_Start/RouteConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web.Mvc; 2 | using System.Web.Routing; 3 | 4 | namespace CrystalReportWebAPI 5 | { 6 | public class RouteConfig 7 | { 8 | public static void RegisterRoutes(RouteCollection routes) 9 | { 10 | routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); 11 | 12 | routes.MapRoute( 13 | name: "Default", 14 | url: "{controller}/{action}/{id}", 15 | defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } 16 | ); 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /CrystalReportWebAPI/App_Start/WebApiConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web.Http; 2 | using System.Web.Http.Cors; 3 | 4 | namespace CrystalReportWebAPI 5 | { 6 | public static class WebApiConfig 7 | { 8 | public static void Register(HttpConfiguration config) 9 | { 10 | // Web API configuration and services 11 | var cors = new EnableCorsAttribute("*", "*", "*"); 12 | config.EnableCors(cors); 13 | 14 | // Web API routes 15 | config.MapHttpAttributeRoutes(); 16 | 17 | config.Routes.MapHttpRoute( 18 | name: "DefaultApi", 19 | routeTemplate: "api/{controller}/{id}", 20 | defaults: new { id = RouteParameter.Optional } 21 | ); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /CrystalReportWebAPI/Areas/HelpPage/ApiDescriptionExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text; 3 | using System.Web; 4 | using System.Web.Http.Description; 5 | 6 | namespace CrystalReportWebAPI.Areas.HelpPage 7 | { 8 | public static class ApiDescriptionExtensions 9 | { 10 | /// 11 | /// Generates an URI-friendly ID for the . E.g. "Get-Values-id_name" instead of "GetValues/{id}?name={name}" 12 | /// 13 | /// The . 14 | /// The ID as a string. 15 | public static string GetFriendlyId(this ApiDescription description) 16 | { 17 | string path = description.RelativePath; 18 | string[] urlParts = path.Split('?'); 19 | string localPath = urlParts[0]; 20 | string queryKeyString = null; 21 | if (urlParts.Length > 1) 22 | { 23 | string query = urlParts[1]; 24 | string[] queryKeys = HttpUtility.ParseQueryString(query).AllKeys; 25 | queryKeyString = String.Join("_", queryKeys); 26 | } 27 | 28 | StringBuilder friendlyPath = new StringBuilder(); 29 | friendlyPath.AppendFormat("{0}-{1}", 30 | description.HttpMethod.Method, 31 | localPath.Replace("/", "-").Replace("{", String.Empty).Replace("}", String.Empty)); 32 | if (queryKeyString != null) 33 | { 34 | friendlyPath.AppendFormat("_{0}", queryKeyString.Replace('.', '-')); 35 | } 36 | return friendlyPath.ToString(); 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /CrystalReportWebAPI/Areas/HelpPage/App_Start/HelpPageConfig.cs: -------------------------------------------------------------------------------- 1 | // Uncomment the following to provide samples for PageResult. Must also add the Microsoft.AspNet.WebApi.OData 2 | // package to your project. 3 | ////#define Handle_PageResultOfT 4 | 5 | using System.Diagnostics.CodeAnalysis; 6 | using System.Net.Http.Headers; 7 | using System.Web.Http; 8 | 9 | #if Handle_PageResultOfT 10 | using System.Web.Http.OData; 11 | #endif 12 | 13 | namespace CrystalReportWebAPI.Areas.HelpPage 14 | { 15 | /// 16 | /// Use this class to customize the Help Page. 17 | /// For example you can set a custom to supply the documentation 18 | /// or you can provide the samples for the requests/responses. 19 | /// 20 | public static class HelpPageConfig 21 | { 22 | [SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", 23 | MessageId = "CrystalReportWebAPI.Areas.HelpPage.TextSample.#ctor(System.String)", 24 | Justification = "End users may choose to merge this string with existing localized resources.")] 25 | [SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", 26 | MessageId = "bsonspec", 27 | Justification = "Part of a URI.")] 28 | public static void Register(HttpConfiguration config) 29 | { 30 | //// Uncomment the following to use the documentation from XML documentation file. 31 | //config.SetDocumentationProvider(new XmlDocumentationProvider(HttpContext.Current.Server.MapPath("~/App_Data/XmlDocument.xml"))); 32 | 33 | //// Uncomment the following to use "sample string" as the sample for all actions that have string as the body parameter or return type. 34 | //// Also, the string arrays will be used for IEnumerable. The sample objects will be serialized into different media type 35 | //// formats by the available formatters. 36 | //config.SetSampleObjects(new Dictionary 37 | //{ 38 | // {typeof(string), "sample string"}, 39 | // {typeof(IEnumerable), new string[]{"sample 1", "sample 2"}} 40 | //}); 41 | 42 | // Extend the following to provide factories for types not handled automatically (those lacking parameterless 43 | // constructors) or for which you prefer to use non-default property values. Line below provides a fallback 44 | // since automatic handling will fail and GeneratePageResult handles only a single type. 45 | #if Handle_PageResultOfT 46 | config.GetHelpPageSampleGenerator().SampleObjectFactories.Add(GeneratePageResult); 47 | #endif 48 | 49 | // Extend the following to use a preset object directly as the sample for all actions that support a media 50 | // type, regardless of the body parameter or return type. The lines below avoid display of binary content. 51 | // The BsonMediaTypeFormatter (if available) is not used to serialize the TextSample object. 52 | config.SetSampleForMediaType( 53 | new TextSample("Binary JSON content. See http://bsonspec.org for details."), 54 | new MediaTypeHeaderValue("application/bson")); 55 | 56 | //// Uncomment the following to use "[0]=foo&[1]=bar" directly as the sample for all actions that support form URL encoded format 57 | //// and have IEnumerable as the body parameter or return type. 58 | //config.SetSampleForType("[0]=foo&[1]=bar", new MediaTypeHeaderValue("application/x-www-form-urlencoded"), typeof(IEnumerable)); 59 | 60 | //// Uncomment the following to use "1234" directly as the request sample for media type "text/plain" on the controller named "Values" 61 | //// and action named "Put". 62 | //config.SetSampleRequest("1234", new MediaTypeHeaderValue("text/plain"), "Values", "Put"); 63 | 64 | //// Uncomment the following to use the image on "../images/aspNetHome.png" directly as the response sample for media type "image/png" 65 | //// on the controller named "Values" and action named "Get" with parameter "id". 66 | //config.SetSampleResponse(new ImageSample("../images/aspNetHome.png"), new MediaTypeHeaderValue("image/png"), "Values", "Get", "id"); 67 | 68 | //// Uncomment the following to correct the sample request when the action expects an HttpRequestMessage with ObjectContent. 69 | //// The sample will be generated as if the controller named "Values" and action named "Get" were having string as the body parameter. 70 | //config.SetActualRequestType(typeof(string), "Values", "Get"); 71 | 72 | //// Uncomment the following to correct the sample response when the action returns an HttpResponseMessage with ObjectContent. 73 | //// The sample will be generated as if the controller named "Values" and action named "Post" were returning a string. 74 | //config.SetActualResponseType(typeof(string), "Values", "Post"); 75 | } 76 | 77 | #if Handle_PageResultOfT 78 | private static object GeneratePageResult(HelpPageSampleGenerator sampleGenerator, Type type) 79 | { 80 | if (type.IsGenericType) 81 | { 82 | Type openGenericType = type.GetGenericTypeDefinition(); 83 | if (openGenericType == typeof(PageResult<>)) 84 | { 85 | // Get the T in PageResult 86 | Type[] typeParameters = type.GetGenericArguments(); 87 | Debug.Assert(typeParameters.Length == 1); 88 | 89 | // Create an enumeration to pass as the first parameter to the PageResult constuctor 90 | Type itemsType = typeof(List<>).MakeGenericType(typeParameters); 91 | object items = sampleGenerator.GetSampleObject(itemsType); 92 | 93 | // Fill in the other information needed to invoke the PageResult constuctor 94 | Type[] parameterTypes = new Type[] { itemsType, typeof(Uri), typeof(long?), }; 95 | object[] parameters = new object[] { items, null, (long)ObjectGenerator.DefaultCollectionSize, }; 96 | 97 | // Call PageResult(IEnumerable items, Uri nextPageLink, long? count) constructor 98 | ConstructorInfo constructor = type.GetConstructor(parameterTypes); 99 | return constructor.Invoke(parameters); 100 | } 101 | } 102 | 103 | return null; 104 | } 105 | #endif 106 | } 107 | } -------------------------------------------------------------------------------- /CrystalReportWebAPI/Areas/HelpPage/Controllers/HelpController.cs: -------------------------------------------------------------------------------- 1 | using CrystalReportWebAPI.Areas.HelpPage.ModelDescriptions; 2 | using CrystalReportWebAPI.Areas.HelpPage.Models; 3 | using System; 4 | using System.Web.Http; 5 | using System.Web.Mvc; 6 | 7 | namespace CrystalReportWebAPI.Areas.HelpPage.Controllers 8 | { 9 | /// 10 | /// The controller that will handle requests for the help page. 11 | /// 12 | public class HelpController : Controller 13 | { 14 | private const string ErrorViewName = "Error"; 15 | 16 | public HelpController() 17 | : this(GlobalConfiguration.Configuration) 18 | { 19 | } 20 | 21 | public HelpController(HttpConfiguration config) 22 | { 23 | Configuration = config; 24 | } 25 | 26 | public HttpConfiguration Configuration { get; private set; } 27 | 28 | public ActionResult Index() 29 | { 30 | ViewBag.DocumentationProvider = Configuration.Services.GetDocumentationProvider(); 31 | return View(Configuration.Services.GetApiExplorer().ApiDescriptions); 32 | } 33 | 34 | public ActionResult Api(string apiId) 35 | { 36 | if (!String.IsNullOrEmpty(apiId)) 37 | { 38 | HelpPageApiModel apiModel = Configuration.GetHelpPageApiModel(apiId); 39 | if (apiModel != null) 40 | { 41 | return View(apiModel); 42 | } 43 | } 44 | 45 | return View(ErrorViewName); 46 | } 47 | 48 | public ActionResult ResourceModel(string modelName) 49 | { 50 | if (!String.IsNullOrEmpty(modelName)) 51 | { 52 | ModelDescriptionGenerator modelDescriptionGenerator = Configuration.GetModelDescriptionGenerator(); 53 | ModelDescription modelDescription; 54 | if (modelDescriptionGenerator.GeneratedModels.TryGetValue(modelName, out modelDescription)) 55 | { 56 | return View(modelDescription); 57 | } 58 | } 59 | 60 | return View(ErrorViewName); 61 | } 62 | } 63 | } -------------------------------------------------------------------------------- /CrystalReportWebAPI/Areas/HelpPage/HelpPage.css: -------------------------------------------------------------------------------- 1 | .help-page h1, 2 | .help-page .h1, 3 | .help-page h2, 4 | .help-page .h2, 5 | .help-page h3, 6 | .help-page .h3, 7 | #body.help-page, 8 | .help-page-table th, 9 | .help-page-table pre, 10 | .help-page-table p { 11 | font-family: "Segoe UI Light", Frutiger, "Frutiger Linotype", "Dejavu Sans", "Helvetica Neue", Arial, sans-serif; 12 | } 13 | 14 | .help-page pre.wrapped { 15 | white-space: -moz-pre-wrap; 16 | white-space: -pre-wrap; 17 | white-space: -o-pre-wrap; 18 | white-space: pre-wrap; 19 | } 20 | 21 | .help-page .warning-message-container { 22 | margin-top: 20px; 23 | padding: 0 10px; 24 | color: #525252; 25 | background: #EFDCA9; 26 | border: 1px solid #CCCCCC; 27 | } 28 | 29 | .help-page-table { 30 | width: 100%; 31 | border-collapse: collapse; 32 | text-align: left; 33 | margin: 0px 0px 20px 0px; 34 | border-top: 1px solid #D4D4D4; 35 | } 36 | 37 | .help-page-table th { 38 | text-align: left; 39 | font-weight: bold; 40 | border-bottom: 1px solid #D4D4D4; 41 | padding: 5px 6px 5px 6px; 42 | } 43 | 44 | .help-page-table td { 45 | border-bottom: 1px solid #D4D4D4; 46 | padding: 10px 8px 10px 8px; 47 | vertical-align: top; 48 | } 49 | 50 | .help-page-table pre, 51 | .help-page-table p { 52 | margin: 0px; 53 | padding: 0px; 54 | font-family: inherit; 55 | font-size: 100%; 56 | } 57 | 58 | .help-page-table tbody tr:hover td { 59 | background-color: #F3F3F3; 60 | } 61 | 62 | .help-page a:hover { 63 | background-color: transparent; 64 | } 65 | 66 | .help-page .sample-header { 67 | border: 2px solid #D4D4D4; 68 | background: #00497E; 69 | color: #FFFFFF; 70 | padding: 8px 15px; 71 | border-bottom: none; 72 | display: inline-block; 73 | margin: 10px 0px 0px 0px; 74 | } 75 | 76 | .help-page .sample-content { 77 | display: block; 78 | border-width: 0; 79 | padding: 15px 20px; 80 | background: #FFFFFF; 81 | border: 2px solid #D4D4D4; 82 | margin: 0px 0px 10px 0px; 83 | } 84 | 85 | .help-page .api-name { 86 | width: 40%; 87 | } 88 | 89 | .help-page .api-documentation { 90 | width: 60%; 91 | } 92 | 93 | .help-page .parameter-name { 94 | width: 20%; 95 | } 96 | 97 | .help-page .parameter-documentation { 98 | width: 40%; 99 | } 100 | 101 | .help-page .parameter-type { 102 | width: 20%; 103 | } 104 | 105 | .help-page .parameter-annotations { 106 | width: 20%; 107 | } 108 | 109 | .help-page h1, 110 | .help-page .h1 { 111 | font-size: 36px; 112 | line-height: normal; 113 | } 114 | 115 | .help-page h2, 116 | .help-page .h2 { 117 | font-size: 24px; 118 | } 119 | 120 | .help-page h3, 121 | .help-page .h3 { 122 | font-size: 20px; 123 | } 124 | 125 | #body.help-page { 126 | font-size: 14px; 127 | line-height: 143%; 128 | color: #333; 129 | } 130 | 131 | .help-page a { 132 | color: #0000EE; 133 | text-decoration: none; 134 | } -------------------------------------------------------------------------------- /CrystalReportWebAPI/Areas/HelpPage/HelpPageAreaRegistration.cs: -------------------------------------------------------------------------------- 1 | using System.Web.Http; 2 | using System.Web.Mvc; 3 | 4 | namespace CrystalReportWebAPI.Areas.HelpPage 5 | { 6 | public class HelpPageAreaRegistration : AreaRegistration 7 | { 8 | public override string AreaName 9 | { 10 | get 11 | { 12 | return "HelpPage"; 13 | } 14 | } 15 | 16 | public override void RegisterArea(AreaRegistrationContext context) 17 | { 18 | context.MapRoute( 19 | "HelpPage_Default", 20 | "Help/{action}/{apiId}", 21 | new { controller = "Help", action = "Index", apiId = UrlParameter.Optional }); 22 | 23 | HelpPageConfig.Register(GlobalConfiguration.Configuration); 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /CrystalReportWebAPI/Areas/HelpPage/ModelDescriptions/CollectionModelDescription.cs: -------------------------------------------------------------------------------- 1 | namespace CrystalReportWebAPI.Areas.HelpPage.ModelDescriptions 2 | { 3 | public class CollectionModelDescription : ModelDescription 4 | { 5 | public ModelDescription ElementDescription { get; set; } 6 | } 7 | } -------------------------------------------------------------------------------- /CrystalReportWebAPI/Areas/HelpPage/ModelDescriptions/ComplexTypeModelDescription.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.ObjectModel; 2 | 3 | namespace CrystalReportWebAPI.Areas.HelpPage.ModelDescriptions 4 | { 5 | public class ComplexTypeModelDescription : ModelDescription 6 | { 7 | public ComplexTypeModelDescription() 8 | { 9 | Properties = new Collection(); 10 | } 11 | 12 | public Collection Properties { get; private set; } 13 | } 14 | } -------------------------------------------------------------------------------- /CrystalReportWebAPI/Areas/HelpPage/ModelDescriptions/DictionaryModelDescription.cs: -------------------------------------------------------------------------------- 1 | namespace CrystalReportWebAPI.Areas.HelpPage.ModelDescriptions 2 | { 3 | public class DictionaryModelDescription : KeyValuePairModelDescription 4 | { 5 | } 6 | } -------------------------------------------------------------------------------- /CrystalReportWebAPI/Areas/HelpPage/ModelDescriptions/EnumTypeModelDescription.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.ObjectModel; 2 | 3 | namespace CrystalReportWebAPI.Areas.HelpPage.ModelDescriptions 4 | { 5 | public class EnumTypeModelDescription : ModelDescription 6 | { 7 | public EnumTypeModelDescription() 8 | { 9 | Values = new Collection(); 10 | } 11 | 12 | public Collection Values { get; private set; } 13 | } 14 | } -------------------------------------------------------------------------------- /CrystalReportWebAPI/Areas/HelpPage/ModelDescriptions/EnumValueDescription.cs: -------------------------------------------------------------------------------- 1 | namespace CrystalReportWebAPI.Areas.HelpPage.ModelDescriptions 2 | { 3 | public class EnumValueDescription 4 | { 5 | public string Documentation { get; set; } 6 | 7 | public string Name { get; set; } 8 | 9 | public string Value { get; set; } 10 | } 11 | } -------------------------------------------------------------------------------- /CrystalReportWebAPI/Areas/HelpPage/ModelDescriptions/IModelDocumentationProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Reflection; 3 | 4 | namespace CrystalReportWebAPI.Areas.HelpPage.ModelDescriptions 5 | { 6 | public interface IModelDocumentationProvider 7 | { 8 | string GetDocumentation(MemberInfo member); 9 | 10 | string GetDocumentation(Type type); 11 | } 12 | } -------------------------------------------------------------------------------- /CrystalReportWebAPI/Areas/HelpPage/ModelDescriptions/KeyValuePairModelDescription.cs: -------------------------------------------------------------------------------- 1 | namespace CrystalReportWebAPI.Areas.HelpPage.ModelDescriptions 2 | { 3 | public class KeyValuePairModelDescription : ModelDescription 4 | { 5 | public ModelDescription KeyModelDescription { get; set; } 6 | 7 | public ModelDescription ValueModelDescription { get; set; } 8 | } 9 | } -------------------------------------------------------------------------------- /CrystalReportWebAPI/Areas/HelpPage/ModelDescriptions/ModelDescription.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace CrystalReportWebAPI.Areas.HelpPage.ModelDescriptions 4 | { 5 | /// 6 | /// Describes a type model. 7 | /// 8 | public abstract class ModelDescription 9 | { 10 | public string Documentation { get; set; } 11 | 12 | public Type ModelType { get; set; } 13 | 14 | public string Name { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /CrystalReportWebAPI/Areas/HelpPage/ModelDescriptions/ModelNameAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace CrystalReportWebAPI.Areas.HelpPage.ModelDescriptions 4 | { 5 | /// 6 | /// Use this attribute to change the name of the generated for a type. 7 | /// 8 | [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum, AllowMultiple = false, Inherited = false)] 9 | public sealed class ModelNameAttribute : Attribute 10 | { 11 | public ModelNameAttribute(string name) 12 | { 13 | Name = name; 14 | } 15 | 16 | public string Name { get; private set; } 17 | } 18 | } -------------------------------------------------------------------------------- /CrystalReportWebAPI/Areas/HelpPage/ModelDescriptions/ModelNameHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | using System.Linq; 4 | using System.Reflection; 5 | 6 | namespace CrystalReportWebAPI.Areas.HelpPage.ModelDescriptions 7 | { 8 | internal static class ModelNameHelper 9 | { 10 | // Modify this to provide custom model name mapping. 11 | public static string GetModelName(Type type) 12 | { 13 | ModelNameAttribute modelNameAttribute = type.GetCustomAttribute(); 14 | if (modelNameAttribute != null && !String.IsNullOrEmpty(modelNameAttribute.Name)) 15 | { 16 | return modelNameAttribute.Name; 17 | } 18 | 19 | string modelName = type.Name; 20 | if (type.IsGenericType) 21 | { 22 | // Format the generic type name to something like: GenericOfAgurment1AndArgument2 23 | Type genericType = type.GetGenericTypeDefinition(); 24 | Type[] genericArguments = type.GetGenericArguments(); 25 | string genericTypeName = genericType.Name; 26 | 27 | // Trim the generic parameter counts from the name 28 | genericTypeName = genericTypeName.Substring(0, genericTypeName.IndexOf('`')); 29 | string[] argumentTypeNames = genericArguments.Select(t => GetModelName(t)).ToArray(); 30 | modelName = String.Format(CultureInfo.InvariantCulture, "{0}Of{1}", genericTypeName, String.Join("And", argumentTypeNames)); 31 | } 32 | 33 | return modelName; 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /CrystalReportWebAPI/Areas/HelpPage/ModelDescriptions/ParameterAnnotation.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace CrystalReportWebAPI.Areas.HelpPage.ModelDescriptions 4 | { 5 | public class ParameterAnnotation 6 | { 7 | public Attribute AnnotationAttribute { get; set; } 8 | 9 | public string Documentation { get; set; } 10 | } 11 | } -------------------------------------------------------------------------------- /CrystalReportWebAPI/Areas/HelpPage/ModelDescriptions/ParameterDescription.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.ObjectModel; 2 | 3 | namespace CrystalReportWebAPI.Areas.HelpPage.ModelDescriptions 4 | { 5 | public class ParameterDescription 6 | { 7 | public ParameterDescription() 8 | { 9 | Annotations = new Collection(); 10 | } 11 | 12 | public Collection Annotations { get; private set; } 13 | 14 | public string Documentation { get; set; } 15 | 16 | public string Name { get; set; } 17 | 18 | public ModelDescription TypeDescription { get; set; } 19 | } 20 | } -------------------------------------------------------------------------------- /CrystalReportWebAPI/Areas/HelpPage/ModelDescriptions/SimpleTypeModelDescription.cs: -------------------------------------------------------------------------------- 1 | namespace CrystalReportWebAPI.Areas.HelpPage.ModelDescriptions 2 | { 3 | public class SimpleTypeModelDescription : ModelDescription 4 | { 5 | } 6 | } -------------------------------------------------------------------------------- /CrystalReportWebAPI/Areas/HelpPage/Models/HelpPageApiModel.cs: -------------------------------------------------------------------------------- 1 | using CrystalReportWebAPI.Areas.HelpPage.ModelDescriptions; 2 | using System.Collections.Generic; 3 | using System.Collections.ObjectModel; 4 | using System.Net.Http.Headers; 5 | using System.Web.Http.Description; 6 | 7 | namespace CrystalReportWebAPI.Areas.HelpPage.Models 8 | { 9 | /// 10 | /// The model that represents an API displayed on the help page. 11 | /// 12 | public class HelpPageApiModel 13 | { 14 | /// 15 | /// Initializes a new instance of the class. 16 | /// 17 | public HelpPageApiModel() 18 | { 19 | UriParameters = new Collection(); 20 | SampleRequests = new Dictionary(); 21 | SampleResponses = new Dictionary(); 22 | ErrorMessages = new Collection(); 23 | } 24 | 25 | /// 26 | /// Gets or sets the that describes the API. 27 | /// 28 | public ApiDescription ApiDescription { get; set; } 29 | 30 | /// 31 | /// Gets or sets the collection that describes the URI parameters for the API. 32 | /// 33 | public Collection UriParameters { get; private set; } 34 | 35 | /// 36 | /// Gets or sets the documentation for the request. 37 | /// 38 | public string RequestDocumentation { get; set; } 39 | 40 | /// 41 | /// Gets or sets the that describes the request body. 42 | /// 43 | public ModelDescription RequestModelDescription { get; set; } 44 | 45 | /// 46 | /// Gets the request body parameter descriptions. 47 | /// 48 | public IList RequestBodyParameters 49 | { 50 | get 51 | { 52 | return GetParameterDescriptions(RequestModelDescription); 53 | } 54 | } 55 | 56 | /// 57 | /// Gets or sets the that describes the resource. 58 | /// 59 | public ModelDescription ResourceDescription { get; set; } 60 | 61 | /// 62 | /// Gets the resource property descriptions. 63 | /// 64 | public IList ResourceProperties 65 | { 66 | get 67 | { 68 | return GetParameterDescriptions(ResourceDescription); 69 | } 70 | } 71 | 72 | /// 73 | /// Gets the sample requests associated with the API. 74 | /// 75 | public IDictionary SampleRequests { get; private set; } 76 | 77 | /// 78 | /// Gets the sample responses associated with the API. 79 | /// 80 | public IDictionary SampleResponses { get; private set; } 81 | 82 | /// 83 | /// Gets the error messages associated with this model. 84 | /// 85 | public Collection ErrorMessages { get; private set; } 86 | 87 | private static IList GetParameterDescriptions(ModelDescription modelDescription) 88 | { 89 | ComplexTypeModelDescription complexTypeModelDescription = modelDescription as ComplexTypeModelDescription; 90 | if (complexTypeModelDescription != null) 91 | { 92 | return complexTypeModelDescription.Properties; 93 | } 94 | 95 | CollectionModelDescription collectionModelDescription = modelDescription as CollectionModelDescription; 96 | if (collectionModelDescription != null) 97 | { 98 | complexTypeModelDescription = collectionModelDescription.ElementDescription as ComplexTypeModelDescription; 99 | if (complexTypeModelDescription != null) 100 | { 101 | return complexTypeModelDescription.Properties; 102 | } 103 | } 104 | 105 | return null; 106 | } 107 | } 108 | } -------------------------------------------------------------------------------- /CrystalReportWebAPI/Areas/HelpPage/SampleGeneration/HelpPageSampleKey.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Net.Http.Headers; 5 | 6 | namespace CrystalReportWebAPI.Areas.HelpPage 7 | { 8 | /// 9 | /// This is used to identify the place where the sample should be applied. 10 | /// 11 | public class HelpPageSampleKey 12 | { 13 | /// 14 | /// Creates a new based on media type. 15 | /// 16 | /// The media type. 17 | public HelpPageSampleKey(MediaTypeHeaderValue mediaType) 18 | { 19 | if (mediaType == null) 20 | { 21 | throw new ArgumentNullException("mediaType"); 22 | } 23 | 24 | ActionName = String.Empty; 25 | ControllerName = String.Empty; 26 | MediaType = mediaType; 27 | ParameterNames = new HashSet(StringComparer.OrdinalIgnoreCase); 28 | } 29 | 30 | /// 31 | /// Creates a new based on media type and CLR type. 32 | /// 33 | /// The media type. 34 | /// The CLR type. 35 | public HelpPageSampleKey(MediaTypeHeaderValue mediaType, Type type) 36 | : this(mediaType) 37 | { 38 | if (type == null) 39 | { 40 | throw new ArgumentNullException("type"); 41 | } 42 | 43 | ParameterType = type; 44 | } 45 | 46 | /// 47 | /// Creates a new based on , controller name, action name and parameter names. 48 | /// 49 | /// The . 50 | /// Name of the controller. 51 | /// Name of the action. 52 | /// The parameter names. 53 | public HelpPageSampleKey(SampleDirection sampleDirection, string controllerName, string actionName, IEnumerable parameterNames) 54 | { 55 | if (!Enum.IsDefined(typeof(SampleDirection), sampleDirection)) 56 | { 57 | throw new InvalidEnumArgumentException("sampleDirection", (int)sampleDirection, typeof(SampleDirection)); 58 | } 59 | if (controllerName == null) 60 | { 61 | throw new ArgumentNullException("controllerName"); 62 | } 63 | if (actionName == null) 64 | { 65 | throw new ArgumentNullException("actionName"); 66 | } 67 | if (parameterNames == null) 68 | { 69 | throw new ArgumentNullException("parameterNames"); 70 | } 71 | 72 | ControllerName = controllerName; 73 | ActionName = actionName; 74 | ParameterNames = new HashSet(parameterNames, StringComparer.OrdinalIgnoreCase); 75 | SampleDirection = sampleDirection; 76 | } 77 | 78 | /// 79 | /// Creates a new based on media type, , controller name, action name and parameter names. 80 | /// 81 | /// The media type. 82 | /// The . 83 | /// Name of the controller. 84 | /// Name of the action. 85 | /// The parameter names. 86 | public HelpPageSampleKey(MediaTypeHeaderValue mediaType, SampleDirection sampleDirection, string controllerName, string actionName, IEnumerable parameterNames) 87 | : this(sampleDirection, controllerName, actionName, parameterNames) 88 | { 89 | if (mediaType == null) 90 | { 91 | throw new ArgumentNullException("mediaType"); 92 | } 93 | 94 | MediaType = mediaType; 95 | } 96 | 97 | /// 98 | /// Gets the name of the controller. 99 | /// 100 | /// 101 | /// The name of the controller. 102 | /// 103 | public string ControllerName { get; private set; } 104 | 105 | /// 106 | /// Gets the name of the action. 107 | /// 108 | /// 109 | /// The name of the action. 110 | /// 111 | public string ActionName { get; private set; } 112 | 113 | /// 114 | /// Gets the media type. 115 | /// 116 | /// 117 | /// The media type. 118 | /// 119 | public MediaTypeHeaderValue MediaType { get; private set; } 120 | 121 | /// 122 | /// Gets the parameter names. 123 | /// 124 | public HashSet ParameterNames { get; private set; } 125 | 126 | public Type ParameterType { get; private set; } 127 | 128 | /// 129 | /// Gets the . 130 | /// 131 | public SampleDirection? SampleDirection { get; private set; } 132 | 133 | public override bool Equals(object obj) 134 | { 135 | HelpPageSampleKey otherKey = obj as HelpPageSampleKey; 136 | if (otherKey == null) 137 | { 138 | return false; 139 | } 140 | 141 | return String.Equals(ControllerName, otherKey.ControllerName, StringComparison.OrdinalIgnoreCase) && 142 | String.Equals(ActionName, otherKey.ActionName, StringComparison.OrdinalIgnoreCase) && 143 | (MediaType == otherKey.MediaType || (MediaType != null && MediaType.Equals(otherKey.MediaType))) && 144 | ParameterType == otherKey.ParameterType && 145 | SampleDirection == otherKey.SampleDirection && 146 | ParameterNames.SetEquals(otherKey.ParameterNames); 147 | } 148 | 149 | public override int GetHashCode() 150 | { 151 | int hashCode = ControllerName.ToUpperInvariant().GetHashCode() ^ ActionName.ToUpperInvariant().GetHashCode(); 152 | if (MediaType != null) 153 | { 154 | hashCode ^= MediaType.GetHashCode(); 155 | } 156 | if (SampleDirection != null) 157 | { 158 | hashCode ^= SampleDirection.GetHashCode(); 159 | } 160 | if (ParameterType != null) 161 | { 162 | hashCode ^= ParameterType.GetHashCode(); 163 | } 164 | foreach (string parameterName in ParameterNames) 165 | { 166 | hashCode ^= parameterName.ToUpperInvariant().GetHashCode(); 167 | } 168 | 169 | return hashCode; 170 | } 171 | } 172 | } -------------------------------------------------------------------------------- /CrystalReportWebAPI/Areas/HelpPage/SampleGeneration/ImageSample.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace CrystalReportWebAPI.Areas.HelpPage 4 | { 5 | /// 6 | /// This represents an image sample on the help page. There's a display template named ImageSample associated with this class. 7 | /// 8 | public class ImageSample 9 | { 10 | /// 11 | /// Initializes a new instance of the class. 12 | /// 13 | /// The URL of an image. 14 | public ImageSample(string src) 15 | { 16 | if (src == null) 17 | { 18 | throw new ArgumentNullException("src"); 19 | } 20 | Src = src; 21 | } 22 | 23 | public string Src { get; private set; } 24 | 25 | public override bool Equals(object obj) 26 | { 27 | ImageSample other = obj as ImageSample; 28 | return other != null && Src == other.Src; 29 | } 30 | 31 | public override int GetHashCode() 32 | { 33 | return Src.GetHashCode(); 34 | } 35 | 36 | public override string ToString() 37 | { 38 | return Src; 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /CrystalReportWebAPI/Areas/HelpPage/SampleGeneration/InvalidSample.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace CrystalReportWebAPI.Areas.HelpPage 4 | { 5 | /// 6 | /// This represents an invalid sample on the help page. There's a display template named InvalidSample associated with this class. 7 | /// 8 | public class InvalidSample 9 | { 10 | public InvalidSample(string errorMessage) 11 | { 12 | if (errorMessage == null) 13 | { 14 | throw new ArgumentNullException("errorMessage"); 15 | } 16 | ErrorMessage = errorMessage; 17 | } 18 | 19 | public string ErrorMessage { get; private set; } 20 | 21 | public override bool Equals(object obj) 22 | { 23 | InvalidSample other = obj as InvalidSample; 24 | return other != null && ErrorMessage == other.ErrorMessage; 25 | } 26 | 27 | public override int GetHashCode() 28 | { 29 | return ErrorMessage.GetHashCode(); 30 | } 31 | 32 | public override string ToString() 33 | { 34 | return ErrorMessage; 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /CrystalReportWebAPI/Areas/HelpPage/SampleGeneration/SampleDirection.cs: -------------------------------------------------------------------------------- 1 | namespace CrystalReportWebAPI.Areas.HelpPage 2 | { 3 | /// 4 | /// Indicates whether the sample is used for request or response 5 | /// 6 | public enum SampleDirection 7 | { 8 | Request = 0, 9 | Response 10 | } 11 | } -------------------------------------------------------------------------------- /CrystalReportWebAPI/Areas/HelpPage/SampleGeneration/TextSample.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace CrystalReportWebAPI.Areas.HelpPage 4 | { 5 | /// 6 | /// This represents a preformatted text sample on the help page. There's a display template named TextSample associated with this class. 7 | /// 8 | public class TextSample 9 | { 10 | public TextSample(string text) 11 | { 12 | if (text == null) 13 | { 14 | throw new ArgumentNullException("text"); 15 | } 16 | Text = text; 17 | } 18 | 19 | public string Text { get; private set; } 20 | 21 | public override bool Equals(object obj) 22 | { 23 | TextSample other = obj as TextSample; 24 | return other != null && Text == other.Text; 25 | } 26 | 27 | public override int GetHashCode() 28 | { 29 | return Text.GetHashCode(); 30 | } 31 | 32 | public override string ToString() 33 | { 34 | return Text; 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /CrystalReportWebAPI/Areas/HelpPage/Views/Help/Api.cshtml: -------------------------------------------------------------------------------- 1 | @using System.Web.Http 2 | @using CrystalReportWebAPI.Areas.HelpPage.Models 3 | @model HelpPageApiModel 4 | 5 | @{ 6 | var description = Model.ApiDescription; 7 | ViewBag.Title = description.HttpMethod.Method + " " + description.RelativePath; 8 | } 9 | 10 | 11 |
12 | 19 |
20 | @Html.DisplayForModel() 21 |
22 |
-------------------------------------------------------------------------------- /CrystalReportWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/ApiGroup.cshtml: -------------------------------------------------------------------------------- 1 | @using System.Web.Http 2 | @using System.Web.Http.Controllers 3 | @using System.Web.Http.Description 4 | @using CrystalReportWebAPI.Areas.HelpPage 5 | @using CrystalReportWebAPI.Areas.HelpPage.Models 6 | @model IGrouping 7 | 8 | @{ 9 | var controllerDocumentation = ViewBag.DocumentationProvider != null ? 10 | ViewBag.DocumentationProvider.GetDocumentation(Model.Key) : 11 | null; 12 | } 13 | 14 |

@Model.Key.ControllerName

15 | @if (!String.IsNullOrEmpty(controllerDocumentation)) 16 | { 17 |

@controllerDocumentation

18 | } 19 | 20 | 21 | 22 | 23 | 24 | @foreach (var api in Model) 25 | { 26 | 27 | 28 | 38 | 39 | } 40 | 41 |
APIDescription
@api.HttpMethod.Method @api.RelativePath 29 | @if (api.Documentation != null) 30 | { 31 |

@api.Documentation

32 | } 33 | else 34 | { 35 |

No documentation available.

36 | } 37 |
-------------------------------------------------------------------------------- /CrystalReportWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/CollectionModelDescription.cshtml: -------------------------------------------------------------------------------- 1 | @using CrystalReportWebAPI.Areas.HelpPage.ModelDescriptions 2 | @model CollectionModelDescription 3 | @if (Model.ElementDescription is ComplexTypeModelDescription) 4 | { 5 | @Html.DisplayFor(m => m.ElementDescription) 6 | } -------------------------------------------------------------------------------- /CrystalReportWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/ComplexTypeModelDescription.cshtml: -------------------------------------------------------------------------------- 1 | @using CrystalReportWebAPI.Areas.HelpPage.ModelDescriptions 2 | @model ComplexTypeModelDescription 3 | @Html.DisplayFor(m => m.Properties, "Parameters") -------------------------------------------------------------------------------- /CrystalReportWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/DictionaryModelDescription.cshtml: -------------------------------------------------------------------------------- 1 | @using CrystalReportWebAPI.Areas.HelpPage.ModelDescriptions 2 | @model DictionaryModelDescription 3 | Dictionary of @Html.DisplayFor(m => Model.KeyModelDescription.ModelType, "ModelDescriptionLink", new { modelDescription = Model.KeyModelDescription }) [key] 4 | and @Html.DisplayFor(m => Model.ValueModelDescription.ModelType, "ModelDescriptionLink", new { modelDescription = Model.ValueModelDescription }) [value] -------------------------------------------------------------------------------- /CrystalReportWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/EnumTypeModelDescription.cshtml: -------------------------------------------------------------------------------- 1 | @using CrystalReportWebAPI.Areas.HelpPage.ModelDescriptions 2 | @model EnumTypeModelDescription 3 | 4 |

Possible enumeration values:

5 | 6 | 7 | 8 | 9 | 10 | 11 | @foreach (EnumValueDescription value in Model.Values) 12 | { 13 | 14 | 15 | 18 | 21 | 22 | } 23 | 24 |
NameValueDescription
@value.Name 16 |

@value.Value

17 |
19 |

@value.Documentation

20 |
-------------------------------------------------------------------------------- /CrystalReportWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/HelpPageApiModel.cshtml: -------------------------------------------------------------------------------- 1 | @using System.Web.Http 2 | @using System.Web.Http.Description 3 | @using CrystalReportWebAPI.Areas.HelpPage.Models 4 | @using CrystalReportWebAPI.Areas.HelpPage.ModelDescriptions 5 | @model HelpPageApiModel 6 | 7 | @{ 8 | ApiDescription description = Model.ApiDescription; 9 | } 10 |

@description.HttpMethod.Method @description.RelativePath

11 |
12 |

@description.Documentation

13 | 14 |

Request Information

15 | 16 |

URI Parameters

17 | @Html.DisplayFor(m => m.UriParameters, "Parameters") 18 | 19 |

Body Parameters

20 | 21 |

@Model.RequestDocumentation

22 | 23 | @if (Model.RequestModelDescription != null) 24 | { 25 | @Html.DisplayFor(m => m.RequestModelDescription.ModelType, "ModelDescriptionLink", new { modelDescription = Model.RequestModelDescription }) 26 | if (Model.RequestBodyParameters != null) 27 | { 28 | @Html.DisplayFor(m => m.RequestBodyParameters, "Parameters") 29 | } 30 | } 31 | else 32 | { 33 |

None.

34 | } 35 | 36 | @if (Model.SampleRequests.Count > 0) 37 | { 38 |

Request Formats

39 | @Html.DisplayFor(m => m.SampleRequests, "Samples") 40 | } 41 | 42 |

Response Information

43 | 44 |

Resource Description

45 | 46 |

@description.ResponseDescription.Documentation

47 | 48 | @if (Model.ResourceDescription != null) 49 | { 50 | @Html.DisplayFor(m => m.ResourceDescription.ModelType, "ModelDescriptionLink", new { modelDescription = Model.ResourceDescription }) 51 | if (Model.ResourceProperties != null) 52 | { 53 | @Html.DisplayFor(m => m.ResourceProperties, "Parameters") 54 | } 55 | } 56 | else 57 | { 58 |

None.

59 | } 60 | 61 | @if (Model.SampleResponses.Count > 0) 62 | { 63 |

Response Formats

64 | @Html.DisplayFor(m => m.SampleResponses, "Samples") 65 | } 66 |
-------------------------------------------------------------------------------- /CrystalReportWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/ImageSample.cshtml: -------------------------------------------------------------------------------- 1 | @using CrystalReportWebAPI.Areas.HelpPage 2 | @model ImageSample 3 | 4 | -------------------------------------------------------------------------------- /CrystalReportWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/InvalidSample.cshtml: -------------------------------------------------------------------------------- 1 | @using CrystalReportWebAPI.Areas.HelpPage 2 | @model InvalidSample 3 | 4 | @if (HttpContext.Current.IsDebuggingEnabled) 5 | { 6 |
7 |

@Model.ErrorMessage

8 |
9 | } 10 | else 11 | { 12 |

Sample not available.

13 | } -------------------------------------------------------------------------------- /CrystalReportWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/KeyValuePairModelDescription.cshtml: -------------------------------------------------------------------------------- 1 | @using CrystalReportWebAPI.Areas.HelpPage.ModelDescriptions 2 | @model KeyValuePairModelDescription 3 | Pair of @Html.DisplayFor(m => Model.KeyModelDescription.ModelType, "ModelDescriptionLink", new { modelDescription = Model.KeyModelDescription }) [key] 4 | and @Html.DisplayFor(m => Model.ValueModelDescription.ModelType, "ModelDescriptionLink", new { modelDescription = Model.ValueModelDescription }) [value] -------------------------------------------------------------------------------- /CrystalReportWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/ModelDescriptionLink.cshtml: -------------------------------------------------------------------------------- 1 | @using CrystalReportWebAPI.Areas.HelpPage.ModelDescriptions 2 | @model Type 3 | @{ 4 | ModelDescription modelDescription = ViewBag.modelDescription; 5 | if (modelDescription is ComplexTypeModelDescription || modelDescription is EnumTypeModelDescription) 6 | { 7 | if (Model == typeof(Object)) 8 | { 9 | @:Object 10 | } 11 | else 12 | { 13 | @Html.ActionLink(modelDescription.Name, "ResourceModel", "Help", new { modelName = modelDescription.Name }, null) 14 | } 15 | } 16 | else if (modelDescription is CollectionModelDescription) 17 | { 18 | var collectionDescription = modelDescription as CollectionModelDescription; 19 | var elementDescription = collectionDescription.ElementDescription; 20 | @:Collection of @Html.DisplayFor(m => elementDescription.ModelType, "ModelDescriptionLink", new { modelDescription = elementDescription }) 21 | } 22 | else 23 | { 24 | @Html.DisplayFor(m => modelDescription) 25 | } 26 | } -------------------------------------------------------------------------------- /CrystalReportWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/Parameters.cshtml: -------------------------------------------------------------------------------- 1 | @using System.Collections.Generic 2 | @using System.Collections.ObjectModel 3 | @using System.Web.Http.Description 4 | @using System.Threading 5 | @using CrystalReportWebAPI.Areas.HelpPage.ModelDescriptions 6 | @model IList 7 | 8 | @if (Model.Count > 0) 9 | { 10 | 11 | 12 | 13 | 14 | 15 | @foreach (ParameterDescription parameter in Model) 16 | { 17 | ModelDescription modelDescription = parameter.TypeDescription; 18 | 19 | 20 | 23 | 26 | 39 | 40 | } 41 | 42 |
NameDescriptionTypeAdditional information
@parameter.Name 21 |

@parameter.Documentation

22 |
24 | @Html.DisplayFor(m => modelDescription.ModelType, "ModelDescriptionLink", new { modelDescription = modelDescription }) 25 | 27 | @if (parameter.Annotations.Count > 0) 28 | { 29 | foreach (var annotation in parameter.Annotations) 30 | { 31 |

@annotation.Documentation

32 | } 33 | } 34 | else 35 | { 36 |

None.

37 | } 38 |
43 | } 44 | else 45 | { 46 |

None.

47 | } -------------------------------------------------------------------------------- /CrystalReportWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/Samples.cshtml: -------------------------------------------------------------------------------- 1 | @using System.Net.Http.Headers 2 | @model Dictionary 3 | 4 | @{ 5 | // Group the samples into a single tab if they are the same. 6 | Dictionary samples = Model.GroupBy(pair => pair.Value).ToDictionary( 7 | pair => String.Join(", ", pair.Select(m => m.Key.ToString()).ToArray()), 8 | pair => pair.Key); 9 | var mediaTypes = samples.Keys; 10 | } 11 |
12 | @foreach (var mediaType in mediaTypes) 13 | { 14 |

@mediaType

15 |
16 | Sample: 17 | @{ 18 | var sample = samples[mediaType]; 19 | if (sample == null) 20 | { 21 |

Sample not available.

22 | } 23 | else 24 | { 25 | @Html.DisplayFor(s => sample); 26 | } 27 | } 28 |
29 | } 30 |
-------------------------------------------------------------------------------- /CrystalReportWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/SimpleTypeModelDescription.cshtml: -------------------------------------------------------------------------------- 1 | @using CrystalReportWebAPI.Areas.HelpPage.ModelDescriptions 2 | @model SimpleTypeModelDescription 3 | @Model.Documentation -------------------------------------------------------------------------------- /CrystalReportWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/TextSample.cshtml: -------------------------------------------------------------------------------- 1 | @using CrystalReportWebAPI.Areas.HelpPage 2 | @model TextSample 3 | 4 |
5 | @Model.Text
6 | 
-------------------------------------------------------------------------------- /CrystalReportWebAPI/Areas/HelpPage/Views/Help/Index.cshtml: -------------------------------------------------------------------------------- 1 | @using System.Web.Http 2 | @using System.Web.Http.Controllers 3 | @using System.Web.Http.Description 4 | @using System.Collections.ObjectModel 5 | @using CrystalReportWebAPI.Areas.HelpPage.Models 6 | @model Collection 7 | 8 | @{ 9 | ViewBag.Title = "ASP.NET Web API Help Page"; 10 | 11 | // Group APIs by controller 12 | ILookup apiGroups = Model.ToLookup(api => api.ActionDescriptor.ControllerDescriptor); 13 | } 14 | 15 | 16 |
17 |
18 |
19 |

@ViewBag.Title

20 |
21 |
22 |
23 |
24 | 32 |
33 | @foreach (var group in apiGroups) 34 | { 35 | @Html.DisplayFor(m => group, "ApiGroup") 36 | } 37 |
38 |
-------------------------------------------------------------------------------- /CrystalReportWebAPI/Areas/HelpPage/Views/Help/ResourceModel.cshtml: -------------------------------------------------------------------------------- 1 | @using System.Web.Http 2 | @using CrystalReportWebAPI.Areas.HelpPage.ModelDescriptions 3 | @model ModelDescription 4 | 5 | 6 |
7 | 14 |

@Model.Name

15 |

@Model.Documentation

16 |
17 | @Html.DisplayFor(m => Model) 18 |
19 |
-------------------------------------------------------------------------------- /CrystalReportWebAPI/Areas/HelpPage/Views/Shared/_Layout.cshtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | @ViewBag.Title 7 | @RenderSection("scripts", required: false) 8 | 9 | 10 | @RenderBody() 11 | 12 | -------------------------------------------------------------------------------- /CrystalReportWebAPI/Areas/HelpPage/Views/Web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /CrystalReportWebAPI/Areas/HelpPage/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | // Change the Layout path below to blend the look and feel of the help page with your existing web pages 3 | Layout = "~/Views/Shared/_Layout.cshtml"; 4 | } -------------------------------------------------------------------------------- /CrystalReportWebAPI/Areas/HelpPage/XmlDocumentationProvider.cs: -------------------------------------------------------------------------------- 1 | using CrystalReportWebAPI.Areas.HelpPage.ModelDescriptions; 2 | using System; 3 | using System.Globalization; 4 | using System.Linq; 5 | using System.Reflection; 6 | using System.Web.Http.Controllers; 7 | using System.Web.Http.Description; 8 | using System.Xml.XPath; 9 | 10 | namespace CrystalReportWebAPI.Areas.HelpPage 11 | { 12 | /// 13 | /// A custom that reads the API documentation from an XML documentation file. 14 | /// 15 | public class XmlDocumentationProvider : IDocumentationProvider, IModelDocumentationProvider 16 | { 17 | private XPathNavigator _documentNavigator; 18 | private const string TypeExpression = "/doc/members/member[@name='T:{0}']"; 19 | private const string MethodExpression = "/doc/members/member[@name='M:{0}']"; 20 | private const string PropertyExpression = "/doc/members/member[@name='P:{0}']"; 21 | private const string FieldExpression = "/doc/members/member[@name='F:{0}']"; 22 | private const string ParameterExpression = "param[@name='{0}']"; 23 | 24 | /// 25 | /// Initializes a new instance of the class. 26 | /// 27 | /// The physical path to XML document. 28 | public XmlDocumentationProvider(string documentPath) 29 | { 30 | if (documentPath == null) 31 | { 32 | throw new ArgumentNullException("documentPath"); 33 | } 34 | XPathDocument xpath = new XPathDocument(documentPath); 35 | _documentNavigator = xpath.CreateNavigator(); 36 | } 37 | 38 | public string GetDocumentation(HttpControllerDescriptor controllerDescriptor) 39 | { 40 | XPathNavigator typeNode = GetTypeNode(controllerDescriptor.ControllerType); 41 | return GetTagValue(typeNode, "summary"); 42 | } 43 | 44 | public virtual string GetDocumentation(HttpActionDescriptor actionDescriptor) 45 | { 46 | XPathNavigator methodNode = GetMethodNode(actionDescriptor); 47 | return GetTagValue(methodNode, "summary"); 48 | } 49 | 50 | public virtual string GetDocumentation(HttpParameterDescriptor parameterDescriptor) 51 | { 52 | ReflectedHttpParameterDescriptor reflectedParameterDescriptor = parameterDescriptor as ReflectedHttpParameterDescriptor; 53 | if (reflectedParameterDescriptor != null) 54 | { 55 | XPathNavigator methodNode = GetMethodNode(reflectedParameterDescriptor.ActionDescriptor); 56 | if (methodNode != null) 57 | { 58 | string parameterName = reflectedParameterDescriptor.ParameterInfo.Name; 59 | XPathNavigator parameterNode = methodNode.SelectSingleNode(String.Format(CultureInfo.InvariantCulture, ParameterExpression, parameterName)); 60 | if (parameterNode != null) 61 | { 62 | return parameterNode.Value.Trim(); 63 | } 64 | } 65 | } 66 | 67 | return null; 68 | } 69 | 70 | public string GetResponseDocumentation(HttpActionDescriptor actionDescriptor) 71 | { 72 | XPathNavigator methodNode = GetMethodNode(actionDescriptor); 73 | return GetTagValue(methodNode, "returns"); 74 | } 75 | 76 | public string GetDocumentation(MemberInfo member) 77 | { 78 | string memberName = String.Format(CultureInfo.InvariantCulture, "{0}.{1}", GetTypeName(member.DeclaringType), member.Name); 79 | string expression = member.MemberType == MemberTypes.Field ? FieldExpression : PropertyExpression; 80 | string selectExpression = String.Format(CultureInfo.InvariantCulture, expression, memberName); 81 | XPathNavigator propertyNode = _documentNavigator.SelectSingleNode(selectExpression); 82 | return GetTagValue(propertyNode, "summary"); 83 | } 84 | 85 | public string GetDocumentation(Type type) 86 | { 87 | XPathNavigator typeNode = GetTypeNode(type); 88 | return GetTagValue(typeNode, "summary"); 89 | } 90 | 91 | private XPathNavigator GetMethodNode(HttpActionDescriptor actionDescriptor) 92 | { 93 | ReflectedHttpActionDescriptor reflectedActionDescriptor = actionDescriptor as ReflectedHttpActionDescriptor; 94 | if (reflectedActionDescriptor != null) 95 | { 96 | string selectExpression = String.Format(CultureInfo.InvariantCulture, MethodExpression, GetMemberName(reflectedActionDescriptor.MethodInfo)); 97 | return _documentNavigator.SelectSingleNode(selectExpression); 98 | } 99 | 100 | return null; 101 | } 102 | 103 | private static string GetMemberName(MethodInfo method) 104 | { 105 | string name = String.Format(CultureInfo.InvariantCulture, "{0}.{1}", GetTypeName(method.DeclaringType), method.Name); 106 | ParameterInfo[] parameters = method.GetParameters(); 107 | if (parameters.Length != 0) 108 | { 109 | string[] parameterTypeNames = parameters.Select(param => GetTypeName(param.ParameterType)).ToArray(); 110 | name += String.Format(CultureInfo.InvariantCulture, "({0})", String.Join(",", parameterTypeNames)); 111 | } 112 | 113 | return name; 114 | } 115 | 116 | private static string GetTagValue(XPathNavigator parentNode, string tagName) 117 | { 118 | if (parentNode != null) 119 | { 120 | XPathNavigator node = parentNode.SelectSingleNode(tagName); 121 | if (node != null) 122 | { 123 | return node.Value.Trim(); 124 | } 125 | } 126 | 127 | return null; 128 | } 129 | 130 | private XPathNavigator GetTypeNode(Type type) 131 | { 132 | string controllerTypeName = GetTypeName(type); 133 | string selectExpression = String.Format(CultureInfo.InvariantCulture, TypeExpression, controllerTypeName); 134 | return _documentNavigator.SelectSingleNode(selectExpression); 135 | } 136 | 137 | private static string GetTypeName(Type type) 138 | { 139 | string name = type.FullName; 140 | if (type.IsGenericType) 141 | { 142 | // Format the generic type name to something like: Generic{System.Int32,System.String} 143 | Type genericType = type.GetGenericTypeDefinition(); 144 | Type[] genericArguments = type.GetGenericArguments(); 145 | string genericTypeName = genericType.FullName; 146 | 147 | // Trim the generic parameter counts from the name 148 | genericTypeName = genericTypeName.Substring(0, genericTypeName.IndexOf('`')); 149 | string[] argumentTypeNames = genericArguments.Select(t => GetTypeName(t)).ToArray(); 150 | name = String.Format(CultureInfo.InvariantCulture, "{0}{{{1}}}", genericTypeName, String.Join(",", argumentTypeNames)); 151 | } 152 | if (type.IsNested) 153 | { 154 | // Changing the nested type name from OuterType+InnerType to OuterType.InnerType to match the XML documentation syntax. 155 | name = name.Replace("+", "."); 156 | } 157 | 158 | return name; 159 | } 160 | } 161 | } -------------------------------------------------------------------------------- /CrystalReportWebAPI/Content/Site.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 50px; 3 | padding-bottom: 20px; 4 | } 5 | 6 | /* Set padding to keep content from hitting the edges */ 7 | .body-content { 8 | padding-left: 15px; 9 | padding-right: 15px; 10 | } 11 | 12 | /* Set width on the form input elements since they're 100% wide by default */ 13 | input, 14 | select, 15 | textarea { 16 | max-width: 280px; 17 | } -------------------------------------------------------------------------------- /CrystalReportWebAPI/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using System.Web.Mvc; 2 | 3 | namespace CrystalReportWebAPI.Controllers 4 | { 5 | public class HomeController : Controller 6 | { 7 | public ActionResult Index() 8 | { 9 | ViewBag.Title = "Home Page"; 10 | 11 | return View(); 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /CrystalReportWebAPI/Controllers/ReportsController.cs: -------------------------------------------------------------------------------- 1 | using CrystalReportWebAPI.Utilities; 2 | using System.Net.Http; 3 | using System.Web.Http; 4 | 5 | namespace CrystalReportWebAPI.Controllers 6 | { 7 | [RoutePrefix("api/Reports")] 8 | public class ReportsController : ApiController 9 | { 10 | [AllowAnonymous] 11 | [Route("Financial/VarianceAnalysisReport")] 12 | [HttpGet] 13 | [ClientCacheWithEtag(60)] //1 min client side caching 14 | public HttpResponseMessage FinancialVarianceAnalysisReport() 15 | { 16 | string reportPath = "~/Reports/Financial"; 17 | string reportFileName = "YTDVarianceCrossTab.rpt"; 18 | string exportFilename = "YTDVarianceCrossTab.pdf"; 19 | 20 | HttpResponseMessage result = CrystalReport.RenderReport(reportPath, reportFileName, exportFilename); 21 | return result; 22 | } 23 | 24 | [AllowAnonymous] 25 | [Route("Demonstration/ComparativeIncomeStatement")] 26 | [HttpGet] 27 | [ClientCacheWithEtag(60)] //1 min client side caching 28 | public HttpResponseMessage DemonstrationComparativeIncomeStatement() 29 | { 30 | string reportPath = "~/Reports/Demonstration"; 31 | string reportFileName = "ComparativeIncomeStatement.rpt"; 32 | string exportFilename = "ComparativeIncomeStatement.pdf"; 33 | 34 | HttpResponseMessage result = CrystalReport.RenderReport(reportPath, reportFileName, exportFilename); 35 | return result; 36 | } 37 | 38 | [AllowAnonymous] 39 | [Route("VersatileandPrecise/Invoice")] 40 | [HttpGet] 41 | [ClientCacheWithEtag(60)] //1 min client side caching 42 | public HttpResponseMessage VersatileandPreciseInvoice() 43 | { 44 | string reportPath = "~/Reports/VersatileandPrecise"; 45 | string reportFileName = "Invoice.rpt"; 46 | string exportFilename = "Invoice.pdf"; 47 | 48 | HttpResponseMessage result = CrystalReport.RenderReport(reportPath, reportFileName, exportFilename); 49 | return result; 50 | } 51 | 52 | [AllowAnonymous] 53 | [Route("VersatileandPrecise/FortifyFinancialAllinOneRetirementSavings")] 54 | [HttpGet] 55 | [ClientCacheWithEtag(60)] //1 min client side caching 56 | public HttpResponseMessage VersatileandPreciseFortifyFinancialAllinOneRetirementSavings() 57 | { 58 | string reportPath = "~/Reports/VersatileandPrecise"; 59 | string reportFileName = "FortifyFinancialAllinOneRetirementSavings.rpt"; 60 | string exportFilename = "FortifyFinancialAllinOneRetirementSavings.pdf"; 61 | 62 | HttpResponseMessage result = CrystalReport.RenderReport(reportPath, reportFileName, exportFilename); 63 | 64 | return result; 65 | } 66 | } 67 | } -------------------------------------------------------------------------------- /CrystalReportWebAPI/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="CrystalReportWebAPI.WebApiApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /CrystalReportWebAPI/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using System.Web.Http; 2 | using System.Web.Mvc; 3 | using System.Web.Optimization; 4 | using System.Web.Routing; 5 | 6 | namespace CrystalReportWebAPI 7 | { 8 | public class WebApiApplication : System.Web.HttpApplication 9 | { 10 | protected void Application_Start() 11 | { 12 | AreaRegistration.RegisterAllAreas(); 13 | GlobalConfiguration.Configure(WebApiConfig.Register); 14 | FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); 15 | RouteConfig.RegisterRoutes(RouteTable.Routes); 16 | BundleConfig.RegisterBundles(BundleTable.Bundles); 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /CrystalReportWebAPI/Models/LoginData.cs: -------------------------------------------------------------------------------- 1 | namespace CrystalReportWebAPI.Models 2 | { 3 | public class LoginData 4 | { 5 | public string Username { get; set; } 6 | public string Password { get; set; } 7 | } 8 | } -------------------------------------------------------------------------------- /CrystalReportWebAPI/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("CrystalReportWebAPI")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("CrystalReportWebAPI")] 12 | [assembly: AssemblyCopyright("Copyright © 2021")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("50708efb-7b81-4c4a-a3f2-8f6f6bf3eb87")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Revision and Build Numbers 32 | // by using the '*' as shown below: 33 | [assembly: AssemblyVersion("1.0.0.0")] 34 | [assembly: AssemblyFileVersion("1.0.0.0")] -------------------------------------------------------------------------------- /CrystalReportWebAPI/Properties/ServiceDependencies/CrystalReportWebAPI - Web Deploy/profile.arm.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#", 3 | "contentVersion": "1.0.0.0", 4 | "metadata": { 5 | "_dependencyType": "appService.windows" 6 | }, 7 | "parameters": { 8 | "resourceGroupName": { 9 | "type": "string", 10 | "defaultValue": "Tutorial-RG", 11 | "metadata": { 12 | "description": "Name of the resource group for the resource. It is recommended to put resources under same resource group for better tracking." 13 | } 14 | }, 15 | "resourceGroupLocation": { 16 | "type": "string", 17 | "defaultValue": "eastus2", 18 | "metadata": { 19 | "description": "Location of the resource group. Resource groups could have different location than resources, however by default we use API versions from latest hybrid profile which support all locations for resource types we support." 20 | } 21 | }, 22 | "resourceName": { 23 | "type": "string", 24 | "defaultValue": "CrystalReportWebAPI", 25 | "metadata": { 26 | "description": "Name of the main resource to be created by this template." 27 | } 28 | }, 29 | "resourceLocation": { 30 | "type": "string", 31 | "defaultValue": "[parameters('resourceGroupLocation')]", 32 | "metadata": { 33 | "description": "Location of the resource. By default use resource group's location, unless the resource provider is not supported there." 34 | } 35 | } 36 | }, 37 | "variables": { 38 | "appServicePlan_name": "[concat('Plan', uniqueString(concat(parameters('resourceName'), subscription().subscriptionId)))]", 39 | "appServicePlan_ResourceId": "[concat('/subscriptions/', subscription().subscriptionId, '/resourceGroups/', parameters('resourceGroupName'), '/providers/Microsoft.Web/serverFarms/', variables('appServicePlan_name'))]" 40 | }, 41 | "resources": [ 42 | { 43 | "type": "Microsoft.Resources/resourceGroups", 44 | "name": "[parameters('resourceGroupName')]", 45 | "location": "[parameters('resourceGroupLocation')]", 46 | "apiVersion": "2019-10-01" 47 | }, 48 | { 49 | "type": "Microsoft.Resources/deployments", 50 | "name": "[concat(parameters('resourceGroupName'), 'Deployment', uniqueString(concat(parameters('resourceName'), subscription().subscriptionId)))]", 51 | "resourceGroup": "[parameters('resourceGroupName')]", 52 | "apiVersion": "2019-10-01", 53 | "dependsOn": [ 54 | "[parameters('resourceGroupName')]" 55 | ], 56 | "properties": { 57 | "mode": "Incremental", 58 | "template": { 59 | "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", 60 | "contentVersion": "1.0.0.0", 61 | "resources": [ 62 | { 63 | "location": "[parameters('resourceLocation')]", 64 | "name": "[parameters('resourceName')]", 65 | "type": "Microsoft.Web/sites", 66 | "apiVersion": "2015-08-01", 67 | "tags": { 68 | "[concat('hidden-related:', variables('appServicePlan_ResourceId'))]": "empty" 69 | }, 70 | "dependsOn": [ 71 | "[variables('appServicePlan_ResourceId')]" 72 | ], 73 | "kind": "app", 74 | "properties": { 75 | "name": "[parameters('resourceName')]", 76 | "kind": "app", 77 | "httpsOnly": true, 78 | "reserved": false, 79 | "serverFarmId": "[variables('appServicePlan_ResourceId')]", 80 | "siteConfig": { 81 | "metadata": [ 82 | { 83 | "name": "CURRENT_STACK", 84 | "value": "dotnetcore" 85 | } 86 | ] 87 | } 88 | }, 89 | "identity": { 90 | "type": "SystemAssigned" 91 | } 92 | }, 93 | { 94 | "location": "[parameters('resourceLocation')]", 95 | "name": "[variables('appServicePlan_name')]", 96 | "type": "Microsoft.Web/serverFarms", 97 | "apiVersion": "2015-08-01", 98 | "sku": { 99 | "name": "S1", 100 | "tier": "Standard", 101 | "family": "S", 102 | "size": "S1" 103 | }, 104 | "properties": { 105 | "name": "[variables('appServicePlan_name')]" 106 | } 107 | } 108 | ] 109 | } 110 | } 111 | } 112 | ] 113 | } -------------------------------------------------------------------------------- /CrystalReportWebAPI/Reports/Demonstration/ComparativeIncomeStatement.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace CrystalReportWebAPI.Reports.Demonstration { 12 | using System; 13 | using System.ComponentModel; 14 | using CrystalDecisions.Shared; 15 | using CrystalDecisions.ReportSource; 16 | using CrystalDecisions.CrystalReports.Engine; 17 | 18 | 19 | public class ComparativeIncomeStatement : ReportClass { 20 | 21 | public ComparativeIncomeStatement() { 22 | } 23 | 24 | public override string ResourceName { 25 | get { 26 | return "ComparativeIncomeStatement.rpt"; 27 | } 28 | set { 29 | // Do nothing 30 | } 31 | } 32 | 33 | public override bool NewGenerator { 34 | get { 35 | return true; 36 | } 37 | set { 38 | // Do nothing 39 | } 40 | } 41 | 42 | public override string FullResourceName { 43 | get { 44 | return "CrystalReportWebAPI.Reports.Demonstration.ComparativeIncomeStatement.rpt"; 45 | } 46 | set { 47 | // Do nothing 48 | } 49 | } 50 | 51 | [Browsable(false)] 52 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 53 | public CrystalDecisions.CrystalReports.Engine.Section ReportHeaderSection2 { 54 | get { 55 | return this.ReportDefinition.Sections[0]; 56 | } 57 | } 58 | 59 | [Browsable(false)] 60 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 61 | public CrystalDecisions.CrystalReports.Engine.Section ReportHeaderSection4 { 62 | get { 63 | return this.ReportDefinition.Sections[1]; 64 | } 65 | } 66 | 67 | [Browsable(false)] 68 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 69 | public CrystalDecisions.CrystalReports.Engine.Section ReportHeaderSection3 { 70 | get { 71 | return this.ReportDefinition.Sections[2]; 72 | } 73 | } 74 | 75 | [Browsable(false)] 76 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 77 | public CrystalDecisions.CrystalReports.Engine.Section PageHeaderSection1 { 78 | get { 79 | return this.ReportDefinition.Sections[3]; 80 | } 81 | } 82 | 83 | [Browsable(false)] 84 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 85 | public CrystalDecisions.CrystalReports.Engine.Section DetailSection1 { 86 | get { 87 | return this.ReportDefinition.Sections[4]; 88 | } 89 | } 90 | 91 | [Browsable(false)] 92 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 93 | public CrystalDecisions.CrystalReports.Engine.Section ReportFooterSection1 { 94 | get { 95 | return this.ReportDefinition.Sections[5]; 96 | } 97 | } 98 | 99 | [Browsable(false)] 100 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 101 | public CrystalDecisions.CrystalReports.Engine.Section PageFooterSection1 { 102 | get { 103 | return this.ReportDefinition.Sections[6]; 104 | } 105 | } 106 | 107 | [Browsable(false)] 108 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 109 | public CrystalDecisions.Shared.IParameterField Parameter_Column1___type { 110 | get { 111 | return this.DataDefinition.ParameterFields[0]; 112 | } 113 | } 114 | 115 | [Browsable(false)] 116 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 117 | public CrystalDecisions.Shared.IParameterField Parameter_Column1___mmyyyy { 118 | get { 119 | return this.DataDefinition.ParameterFields[1]; 120 | } 121 | } 122 | 123 | [Browsable(false)] 124 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 125 | public CrystalDecisions.Shared.IParameterField Parameter_Column2___type { 126 | get { 127 | return this.DataDefinition.ParameterFields[2]; 128 | } 129 | } 130 | 131 | [Browsable(false)] 132 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 133 | public CrystalDecisions.Shared.IParameterField Parameter_Column2___mmyyyy { 134 | get { 135 | return this.DataDefinition.ParameterFields[3]; 136 | } 137 | } 138 | } 139 | 140 | [System.Drawing.ToolboxBitmapAttribute(typeof(CrystalDecisions.Shared.ExportOptions), "report.bmp")] 141 | public class CachedComparativeIncomeStatement : Component, ICachedReport { 142 | 143 | public CachedComparativeIncomeStatement() { 144 | } 145 | 146 | [Browsable(false)] 147 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 148 | public virtual bool IsCacheable { 149 | get { 150 | return true; 151 | } 152 | set { 153 | // 154 | } 155 | } 156 | 157 | [Browsable(false)] 158 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 159 | public virtual bool ShareDBLogonInfo { 160 | get { 161 | return false; 162 | } 163 | set { 164 | // 165 | } 166 | } 167 | 168 | [Browsable(false)] 169 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 170 | public virtual System.TimeSpan CacheTimeOut { 171 | get { 172 | return CachedReportConstants.DEFAULT_TIMEOUT; 173 | } 174 | set { 175 | // 176 | } 177 | } 178 | 179 | public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { 180 | ComparativeIncomeStatement rpt = new ComparativeIncomeStatement(); 181 | rpt.Site = this.Site; 182 | return rpt; 183 | } 184 | 185 | public virtual string GetCustomizedCacheKey(RequestContext request) { 186 | String key = null; 187 | // // The following is the code used to generate the default 188 | // // cache key for caching report jobs in the ASP.NET Cache. 189 | // // Feel free to modify this code to suit your needs. 190 | // // Returning key == null causes the default cache key to 191 | // // be generated. 192 | // 193 | // key = RequestContext.BuildCompleteCacheKey( 194 | // request, 195 | // null, // sReportFilename 196 | // this.GetType(), 197 | // this.ShareDBLogonInfo ); 198 | return key; 199 | } 200 | } 201 | } 202 | -------------------------------------------------------------------------------- /CrystalReportWebAPI/Reports/Demonstration/ComparativeIncomeStatement.rpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workcontrolgit/CrystalReportWebAPI/672305af39b0801f4bd1e679a785687b5dc765d6/CrystalReportWebAPI/Reports/Demonstration/ComparativeIncomeStatement.rpt -------------------------------------------------------------------------------- /CrystalReportWebAPI/Reports/Demonstration/OrderProcessingEfficiencyDashboard.rpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workcontrolgit/CrystalReportWebAPI/672305af39b0801f4bd1e679a785687b5dc765d6/CrystalReportWebAPI/Reports/Demonstration/OrderProcessingEfficiencyDashboard.rpt -------------------------------------------------------------------------------- /CrystalReportWebAPI/Reports/Demonstration/WorldSalesReport.rpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workcontrolgit/CrystalReportWebAPI/672305af39b0801f4bd1e679a785687b5dc765d6/CrystalReportWebAPI/Reports/Demonstration/WorldSalesReport.rpt -------------------------------------------------------------------------------- /CrystalReportWebAPI/Reports/Financial/ConsolidatedIncomeStatement.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace CrystalReportWebAPI.Reports.Financial { 12 | using System; 13 | using System.ComponentModel; 14 | using CrystalDecisions.Shared; 15 | using CrystalDecisions.ReportSource; 16 | using CrystalDecisions.CrystalReports.Engine; 17 | 18 | 19 | public class ConsolidatedIncomeStatement : ReportClass { 20 | 21 | public ConsolidatedIncomeStatement() { 22 | } 23 | 24 | public override string ResourceName { 25 | get { 26 | return "ConsolidatedIncomeStatement.rpt"; 27 | } 28 | set { 29 | // Do nothing 30 | } 31 | } 32 | 33 | public override bool NewGenerator { 34 | get { 35 | return true; 36 | } 37 | set { 38 | // Do nothing 39 | } 40 | } 41 | 42 | public override string FullResourceName { 43 | get { 44 | return "CrystalReportWebAPI.Reports.Financial.ConsolidatedIncomeStatement.rpt"; 45 | } 46 | set { 47 | // Do nothing 48 | } 49 | } 50 | 51 | [Browsable(false)] 52 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 53 | public CrystalDecisions.CrystalReports.Engine.Section ReportHeaderSection2 { 54 | get { 55 | return this.ReportDefinition.Sections[0]; 56 | } 57 | } 58 | 59 | [Browsable(false)] 60 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 61 | public CrystalDecisions.CrystalReports.Engine.Section ReportHeaderSection1 { 62 | get { 63 | return this.ReportDefinition.Sections[1]; 64 | } 65 | } 66 | 67 | [Browsable(false)] 68 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 69 | public CrystalDecisions.CrystalReports.Engine.Section PageHeaderSection1 { 70 | get { 71 | return this.ReportDefinition.Sections[2]; 72 | } 73 | } 74 | 75 | [Browsable(false)] 76 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 77 | public CrystalDecisions.CrystalReports.Engine.Section DetailSection1 { 78 | get { 79 | return this.ReportDefinition.Sections[3]; 80 | } 81 | } 82 | 83 | [Browsable(false)] 84 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 85 | public CrystalDecisions.CrystalReports.Engine.Section ReportFooterSection1 { 86 | get { 87 | return this.ReportDefinition.Sections[4]; 88 | } 89 | } 90 | 91 | [Browsable(false)] 92 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 93 | public CrystalDecisions.CrystalReports.Engine.Section ReportFooterSection2 { 94 | get { 95 | return this.ReportDefinition.Sections[5]; 96 | } 97 | } 98 | 99 | [Browsable(false)] 100 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 101 | public CrystalDecisions.CrystalReports.Engine.Section PageFooterSection2 { 102 | get { 103 | return this.ReportDefinition.Sections[6]; 104 | } 105 | } 106 | 107 | [Browsable(false)] 108 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 109 | public CrystalDecisions.Shared.IParameterField Parameter_end_date { 110 | get { 111 | return this.DataDefinition.ParameterFields[0]; 112 | } 113 | } 114 | } 115 | 116 | [System.Drawing.ToolboxBitmapAttribute(typeof(CrystalDecisions.Shared.ExportOptions), "report.bmp")] 117 | public class CachedConsolidatedIncomeStatement : Component, ICachedReport { 118 | 119 | public CachedConsolidatedIncomeStatement() { 120 | } 121 | 122 | [Browsable(false)] 123 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 124 | public virtual bool IsCacheable { 125 | get { 126 | return true; 127 | } 128 | set { 129 | // 130 | } 131 | } 132 | 133 | [Browsable(false)] 134 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 135 | public virtual bool ShareDBLogonInfo { 136 | get { 137 | return false; 138 | } 139 | set { 140 | // 141 | } 142 | } 143 | 144 | [Browsable(false)] 145 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 146 | public virtual System.TimeSpan CacheTimeOut { 147 | get { 148 | return CachedReportConstants.DEFAULT_TIMEOUT; 149 | } 150 | set { 151 | // 152 | } 153 | } 154 | 155 | public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { 156 | ConsolidatedIncomeStatement rpt = new ConsolidatedIncomeStatement(); 157 | rpt.Site = this.Site; 158 | return rpt; 159 | } 160 | 161 | public virtual string GetCustomizedCacheKey(RequestContext request) { 162 | String key = null; 163 | // // The following is the code used to generate the default 164 | // // cache key for caching report jobs in the ASP.NET Cache. 165 | // // Feel free to modify this code to suit your needs. 166 | // // Returning key == null causes the default cache key to 167 | // // be generated. 168 | // 169 | // key = RequestContext.BuildCompleteCacheKey( 170 | // request, 171 | // null, // sReportFilename 172 | // this.GetType(), 173 | // this.ShareDBLogonInfo ); 174 | return key; 175 | } 176 | } 177 | } 178 | -------------------------------------------------------------------------------- /CrystalReportWebAPI/Reports/Financial/ConsolidatedIncomeStatement.rpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workcontrolgit/CrystalReportWebAPI/672305af39b0801f4bd1e679a785687b5dc765d6/CrystalReportWebAPI/Reports/Financial/ConsolidatedIncomeStatement.rpt -------------------------------------------------------------------------------- /CrystalReportWebAPI/Reports/Financial/IncomeStatement.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace CrystalReportWebAPI.Reports.Financial { 12 | using System; 13 | using System.ComponentModel; 14 | using CrystalDecisions.Shared; 15 | using CrystalDecisions.ReportSource; 16 | using CrystalDecisions.CrystalReports.Engine; 17 | 18 | 19 | public class IncomeStatement : ReportClass { 20 | 21 | public IncomeStatement() { 22 | } 23 | 24 | public override string ResourceName { 25 | get { 26 | return "IncomeStatement.rpt"; 27 | } 28 | set { 29 | // Do nothing 30 | } 31 | } 32 | 33 | public override bool NewGenerator { 34 | get { 35 | return true; 36 | } 37 | set { 38 | // Do nothing 39 | } 40 | } 41 | 42 | public override string FullResourceName { 43 | get { 44 | return "CrystalReportWebAPI.Reports.Financial.IncomeStatement.rpt"; 45 | } 46 | set { 47 | // Do nothing 48 | } 49 | } 50 | 51 | [Browsable(false)] 52 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 53 | public CrystalDecisions.CrystalReports.Engine.Section ReportHeaderSection2 { 54 | get { 55 | return this.ReportDefinition.Sections[0]; 56 | } 57 | } 58 | 59 | [Browsable(false)] 60 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 61 | public CrystalDecisions.CrystalReports.Engine.Section ReportHeaderSection1 { 62 | get { 63 | return this.ReportDefinition.Sections[1]; 64 | } 65 | } 66 | 67 | [Browsable(false)] 68 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 69 | public CrystalDecisions.CrystalReports.Engine.Section PageHeaderSection1 { 70 | get { 71 | return this.ReportDefinition.Sections[2]; 72 | } 73 | } 74 | 75 | [Browsable(false)] 76 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 77 | public CrystalDecisions.CrystalReports.Engine.Section DetailSection1 { 78 | get { 79 | return this.ReportDefinition.Sections[3]; 80 | } 81 | } 82 | 83 | [Browsable(false)] 84 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 85 | public CrystalDecisions.CrystalReports.Engine.Section ReportFooterSection1 { 86 | get { 87 | return this.ReportDefinition.Sections[4]; 88 | } 89 | } 90 | 91 | [Browsable(false)] 92 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 93 | public CrystalDecisions.CrystalReports.Engine.Section PageFooterSection1 { 94 | get { 95 | return this.ReportDefinition.Sections[5]; 96 | } 97 | } 98 | 99 | [Browsable(false)] 100 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 101 | public CrystalDecisions.Shared.IParameterField Parameter_end_date { 102 | get { 103 | return this.DataDefinition.ParameterFields[0]; 104 | } 105 | } 106 | } 107 | 108 | [System.Drawing.ToolboxBitmapAttribute(typeof(CrystalDecisions.Shared.ExportOptions), "report.bmp")] 109 | public class CachedIncomeStatement : Component, ICachedReport { 110 | 111 | public CachedIncomeStatement() { 112 | } 113 | 114 | [Browsable(false)] 115 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 116 | public virtual bool IsCacheable { 117 | get { 118 | return true; 119 | } 120 | set { 121 | // 122 | } 123 | } 124 | 125 | [Browsable(false)] 126 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 127 | public virtual bool ShareDBLogonInfo { 128 | get { 129 | return false; 130 | } 131 | set { 132 | // 133 | } 134 | } 135 | 136 | [Browsable(false)] 137 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 138 | public virtual System.TimeSpan CacheTimeOut { 139 | get { 140 | return CachedReportConstants.DEFAULT_TIMEOUT; 141 | } 142 | set { 143 | // 144 | } 145 | } 146 | 147 | public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { 148 | IncomeStatement rpt = new IncomeStatement(); 149 | rpt.Site = this.Site; 150 | return rpt; 151 | } 152 | 153 | public virtual string GetCustomizedCacheKey(RequestContext request) { 154 | String key = null; 155 | // // The following is the code used to generate the default 156 | // // cache key for caching report jobs in the ASP.NET Cache. 157 | // // Feel free to modify this code to suit your needs. 158 | // // Returning key == null causes the default cache key to 159 | // // be generated. 160 | // 161 | // key = RequestContext.BuildCompleteCacheKey( 162 | // request, 163 | // null, // sReportFilename 164 | // this.GetType(), 165 | // this.ShareDBLogonInfo ); 166 | return key; 167 | } 168 | } 169 | } 170 | -------------------------------------------------------------------------------- /CrystalReportWebAPI/Reports/Financial/IncomeStatement.rpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workcontrolgit/CrystalReportWebAPI/672305af39b0801f4bd1e679a785687b5dc765d6/CrystalReportWebAPI/Reports/Financial/IncomeStatement.rpt -------------------------------------------------------------------------------- /CrystalReportWebAPI/Reports/Financial/MonthlyVarianceCrossTab.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace CrystalReportWebAPI.Reports.Financial { 12 | using System; 13 | using System.ComponentModel; 14 | using CrystalDecisions.Shared; 15 | using CrystalDecisions.ReportSource; 16 | using CrystalDecisions.CrystalReports.Engine; 17 | 18 | 19 | public class MonthlyVarianceCrossTab : ReportClass { 20 | 21 | public MonthlyVarianceCrossTab() { 22 | } 23 | 24 | public override string ResourceName { 25 | get { 26 | return "MonthlyVarianceCrossTab.rpt"; 27 | } 28 | set { 29 | // Do nothing 30 | } 31 | } 32 | 33 | public override bool NewGenerator { 34 | get { 35 | return true; 36 | } 37 | set { 38 | // Do nothing 39 | } 40 | } 41 | 42 | public override string FullResourceName { 43 | get { 44 | return "CrystalReportWebAPI.Reports.Financial.MonthlyVarianceCrossTab.rpt"; 45 | } 46 | set { 47 | // Do nothing 48 | } 49 | } 50 | 51 | [Browsable(false)] 52 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 53 | public CrystalDecisions.CrystalReports.Engine.Section ReportHeaderSection2 { 54 | get { 55 | return this.ReportDefinition.Sections[0]; 56 | } 57 | } 58 | 59 | [Browsable(false)] 60 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 61 | public CrystalDecisions.CrystalReports.Engine.Section ReportHeaderSection1 { 62 | get { 63 | return this.ReportDefinition.Sections[1]; 64 | } 65 | } 66 | 67 | [Browsable(false)] 68 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 69 | public CrystalDecisions.CrystalReports.Engine.Section PageHeaderSection1 { 70 | get { 71 | return this.ReportDefinition.Sections[2]; 72 | } 73 | } 74 | 75 | [Browsable(false)] 76 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 77 | public CrystalDecisions.CrystalReports.Engine.Section DetailSection1 { 78 | get { 79 | return this.ReportDefinition.Sections[3]; 80 | } 81 | } 82 | 83 | [Browsable(false)] 84 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 85 | public CrystalDecisions.CrystalReports.Engine.Section ReportFooterSection1 { 86 | get { 87 | return this.ReportDefinition.Sections[4]; 88 | } 89 | } 90 | 91 | [Browsable(false)] 92 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 93 | public CrystalDecisions.CrystalReports.Engine.Section PageFooterSection1 { 94 | get { 95 | return this.ReportDefinition.Sections[5]; 96 | } 97 | } 98 | 99 | [Browsable(false)] 100 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 101 | public CrystalDecisions.Shared.IParameterField Parameter_end_date { 102 | get { 103 | return this.DataDefinition.ParameterFields[0]; 104 | } 105 | } 106 | } 107 | 108 | [System.Drawing.ToolboxBitmapAttribute(typeof(CrystalDecisions.Shared.ExportOptions), "report.bmp")] 109 | public class CachedMonthlyVarianceCrossTab : Component, ICachedReport { 110 | 111 | public CachedMonthlyVarianceCrossTab() { 112 | } 113 | 114 | [Browsable(false)] 115 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 116 | public virtual bool IsCacheable { 117 | get { 118 | return true; 119 | } 120 | set { 121 | // 122 | } 123 | } 124 | 125 | [Browsable(false)] 126 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 127 | public virtual bool ShareDBLogonInfo { 128 | get { 129 | return false; 130 | } 131 | set { 132 | // 133 | } 134 | } 135 | 136 | [Browsable(false)] 137 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 138 | public virtual System.TimeSpan CacheTimeOut { 139 | get { 140 | return CachedReportConstants.DEFAULT_TIMEOUT; 141 | } 142 | set { 143 | // 144 | } 145 | } 146 | 147 | public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { 148 | MonthlyVarianceCrossTab rpt = new MonthlyVarianceCrossTab(); 149 | rpt.Site = this.Site; 150 | return rpt; 151 | } 152 | 153 | public virtual string GetCustomizedCacheKey(RequestContext request) { 154 | String key = null; 155 | // // The following is the code used to generate the default 156 | // // cache key for caching report jobs in the ASP.NET Cache. 157 | // // Feel free to modify this code to suit your needs. 158 | // // Returning key == null causes the default cache key to 159 | // // be generated. 160 | // 161 | // key = RequestContext.BuildCompleteCacheKey( 162 | // request, 163 | // null, // sReportFilename 164 | // this.GetType(), 165 | // this.ShareDBLogonInfo ); 166 | return key; 167 | } 168 | } 169 | } 170 | -------------------------------------------------------------------------------- /CrystalReportWebAPI/Reports/Financial/MonthlyVarianceCrossTab.rpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workcontrolgit/CrystalReportWebAPI/672305af39b0801f4bd1e679a785687b5dc765d6/CrystalReportWebAPI/Reports/Financial/MonthlyVarianceCrossTab.rpt -------------------------------------------------------------------------------- /CrystalReportWebAPI/Reports/Financial/RollingQuarterIncomeStatement.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace CrystalReportWebAPI.Reports.Financial { 12 | using System; 13 | using System.ComponentModel; 14 | using CrystalDecisions.Shared; 15 | using CrystalDecisions.ReportSource; 16 | using CrystalDecisions.CrystalReports.Engine; 17 | 18 | 19 | public class RollingQuarterIncomeStatement : ReportClass { 20 | 21 | public RollingQuarterIncomeStatement() { 22 | } 23 | 24 | public override string ResourceName { 25 | get { 26 | return "RollingQuarterIncomeStatement.rpt"; 27 | } 28 | set { 29 | // Do nothing 30 | } 31 | } 32 | 33 | public override bool NewGenerator { 34 | get { 35 | return true; 36 | } 37 | set { 38 | // Do nothing 39 | } 40 | } 41 | 42 | public override string FullResourceName { 43 | get { 44 | return "CrystalReportWebAPI.Reports.Financial.RollingQuarterIncomeStatement.rpt"; 45 | } 46 | set { 47 | // Do nothing 48 | } 49 | } 50 | 51 | [Browsable(false)] 52 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 53 | public CrystalDecisions.CrystalReports.Engine.Section ReportHeaderSection2 { 54 | get { 55 | return this.ReportDefinition.Sections[0]; 56 | } 57 | } 58 | 59 | [Browsable(false)] 60 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 61 | public CrystalDecisions.CrystalReports.Engine.Section ReportHeaderSection3 { 62 | get { 63 | return this.ReportDefinition.Sections[1]; 64 | } 65 | } 66 | 67 | [Browsable(false)] 68 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 69 | public CrystalDecisions.CrystalReports.Engine.Section ReportHeaderSection1 { 70 | get { 71 | return this.ReportDefinition.Sections[2]; 72 | } 73 | } 74 | 75 | [Browsable(false)] 76 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 77 | public CrystalDecisions.CrystalReports.Engine.Section PageHeaderSection1 { 78 | get { 79 | return this.ReportDefinition.Sections[3]; 80 | } 81 | } 82 | 83 | [Browsable(false)] 84 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 85 | public CrystalDecisions.CrystalReports.Engine.Section DetailSection1 { 86 | get { 87 | return this.ReportDefinition.Sections[4]; 88 | } 89 | } 90 | 91 | [Browsable(false)] 92 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 93 | public CrystalDecisions.CrystalReports.Engine.Section ReportFooterSection1 { 94 | get { 95 | return this.ReportDefinition.Sections[5]; 96 | } 97 | } 98 | 99 | [Browsable(false)] 100 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 101 | public CrystalDecisions.CrystalReports.Engine.Section PageFooterSection1 { 102 | get { 103 | return this.ReportDefinition.Sections[6]; 104 | } 105 | } 106 | 107 | [Browsable(false)] 108 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 109 | public CrystalDecisions.Shared.IParameterField Parameter_end_date { 110 | get { 111 | return this.DataDefinition.ParameterFields[0]; 112 | } 113 | } 114 | } 115 | 116 | [System.Drawing.ToolboxBitmapAttribute(typeof(CrystalDecisions.Shared.ExportOptions), "report.bmp")] 117 | public class CachedRollingQuarterIncomeStatement : Component, ICachedReport { 118 | 119 | public CachedRollingQuarterIncomeStatement() { 120 | } 121 | 122 | [Browsable(false)] 123 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 124 | public virtual bool IsCacheable { 125 | get { 126 | return true; 127 | } 128 | set { 129 | // 130 | } 131 | } 132 | 133 | [Browsable(false)] 134 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 135 | public virtual bool ShareDBLogonInfo { 136 | get { 137 | return false; 138 | } 139 | set { 140 | // 141 | } 142 | } 143 | 144 | [Browsable(false)] 145 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 146 | public virtual System.TimeSpan CacheTimeOut { 147 | get { 148 | return CachedReportConstants.DEFAULT_TIMEOUT; 149 | } 150 | set { 151 | // 152 | } 153 | } 154 | 155 | public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { 156 | RollingQuarterIncomeStatement rpt = new RollingQuarterIncomeStatement(); 157 | rpt.Site = this.Site; 158 | return rpt; 159 | } 160 | 161 | public virtual string GetCustomizedCacheKey(RequestContext request) { 162 | String key = null; 163 | // // The following is the code used to generate the default 164 | // // cache key for caching report jobs in the ASP.NET Cache. 165 | // // Feel free to modify this code to suit your needs. 166 | // // Returning key == null causes the default cache key to 167 | // // be generated. 168 | // 169 | // key = RequestContext.BuildCompleteCacheKey( 170 | // request, 171 | // null, // sReportFilename 172 | // this.GetType(), 173 | // this.ShareDBLogonInfo ); 174 | return key; 175 | } 176 | } 177 | } 178 | -------------------------------------------------------------------------------- /CrystalReportWebAPI/Reports/Financial/RollingQuarterIncomeStatement.rpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workcontrolgit/CrystalReportWebAPI/672305af39b0801f4bd1e679a785687b5dc765d6/CrystalReportWebAPI/Reports/Financial/RollingQuarterIncomeStatement.rpt -------------------------------------------------------------------------------- /CrystalReportWebAPI/Reports/Financial/SortedVarianceAnalysisReport.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace CrystalReportWebAPI.Reports.Financial { 12 | using System; 13 | using System.ComponentModel; 14 | using CrystalDecisions.Shared; 15 | using CrystalDecisions.ReportSource; 16 | using CrystalDecisions.CrystalReports.Engine; 17 | 18 | 19 | public class SortedVarianceAnalysisReport : ReportClass { 20 | 21 | public SortedVarianceAnalysisReport() { 22 | } 23 | 24 | public override string ResourceName { 25 | get { 26 | return "SortedVarianceAnalysisReport.rpt"; 27 | } 28 | set { 29 | // Do nothing 30 | } 31 | } 32 | 33 | public override bool NewGenerator { 34 | get { 35 | return true; 36 | } 37 | set { 38 | // Do nothing 39 | } 40 | } 41 | 42 | public override string FullResourceName { 43 | get { 44 | return "CrystalReportWebAPI.Reports.Financial.SortedVarianceAnalysisReport.rpt"; 45 | } 46 | set { 47 | // Do nothing 48 | } 49 | } 50 | 51 | [Browsable(false)] 52 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 53 | public CrystalDecisions.CrystalReports.Engine.Section ReportHeaderSection2 { 54 | get { 55 | return this.ReportDefinition.Sections[0]; 56 | } 57 | } 58 | 59 | [Browsable(false)] 60 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 61 | public CrystalDecisions.CrystalReports.Engine.Section ReportHeaderSection1 { 62 | get { 63 | return this.ReportDefinition.Sections[1]; 64 | } 65 | } 66 | 67 | [Browsable(false)] 68 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 69 | public CrystalDecisions.CrystalReports.Engine.Section PageHeaderSection1 { 70 | get { 71 | return this.ReportDefinition.Sections[2]; 72 | } 73 | } 74 | 75 | [Browsable(false)] 76 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 77 | public CrystalDecisions.CrystalReports.Engine.Section DetailSection1 { 78 | get { 79 | return this.ReportDefinition.Sections[3]; 80 | } 81 | } 82 | 83 | [Browsable(false)] 84 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 85 | public CrystalDecisions.CrystalReports.Engine.Section ReportFooterSection2 { 86 | get { 87 | return this.ReportDefinition.Sections[4]; 88 | } 89 | } 90 | 91 | [Browsable(false)] 92 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 93 | public CrystalDecisions.CrystalReports.Engine.Section PageFooterSection2 { 94 | get { 95 | return this.ReportDefinition.Sections[5]; 96 | } 97 | } 98 | 99 | [Browsable(false)] 100 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 101 | public CrystalDecisions.Shared.IParameterField Parameter_end_date { 102 | get { 103 | return this.DataDefinition.ParameterFields[0]; 104 | } 105 | } 106 | } 107 | 108 | [System.Drawing.ToolboxBitmapAttribute(typeof(CrystalDecisions.Shared.ExportOptions), "report.bmp")] 109 | public class CachedSortedVarianceAnalysisReport : Component, ICachedReport { 110 | 111 | public CachedSortedVarianceAnalysisReport() { 112 | } 113 | 114 | [Browsable(false)] 115 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 116 | public virtual bool IsCacheable { 117 | get { 118 | return true; 119 | } 120 | set { 121 | // 122 | } 123 | } 124 | 125 | [Browsable(false)] 126 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 127 | public virtual bool ShareDBLogonInfo { 128 | get { 129 | return false; 130 | } 131 | set { 132 | // 133 | } 134 | } 135 | 136 | [Browsable(false)] 137 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 138 | public virtual System.TimeSpan CacheTimeOut { 139 | get { 140 | return CachedReportConstants.DEFAULT_TIMEOUT; 141 | } 142 | set { 143 | // 144 | } 145 | } 146 | 147 | public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { 148 | SortedVarianceAnalysisReport rpt = new SortedVarianceAnalysisReport(); 149 | rpt.Site = this.Site; 150 | return rpt; 151 | } 152 | 153 | public virtual string GetCustomizedCacheKey(RequestContext request) { 154 | String key = null; 155 | // // The following is the code used to generate the default 156 | // // cache key for caching report jobs in the ASP.NET Cache. 157 | // // Feel free to modify this code to suit your needs. 158 | // // Returning key == null causes the default cache key to 159 | // // be generated. 160 | // 161 | // key = RequestContext.BuildCompleteCacheKey( 162 | // request, 163 | // null, // sReportFilename 164 | // this.GetType(), 165 | // this.ShareDBLogonInfo ); 166 | return key; 167 | } 168 | } 169 | } 170 | -------------------------------------------------------------------------------- /CrystalReportWebAPI/Reports/Financial/SortedVarianceAnalysisReport.rpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workcontrolgit/CrystalReportWebAPI/672305af39b0801f4bd1e679a785687b5dc765d6/CrystalReportWebAPI/Reports/Financial/SortedVarianceAnalysisReport.rpt -------------------------------------------------------------------------------- /CrystalReportWebAPI/Reports/Financial/TrialBalance.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace CrystalReportWebAPI.Reports.Financial { 12 | using System; 13 | using System.ComponentModel; 14 | using CrystalDecisions.Shared; 15 | using CrystalDecisions.ReportSource; 16 | using CrystalDecisions.CrystalReports.Engine; 17 | 18 | 19 | public class TrialBalance : ReportClass { 20 | 21 | public TrialBalance() { 22 | } 23 | 24 | public override string ResourceName { 25 | get { 26 | return "TrialBalance.rpt"; 27 | } 28 | set { 29 | // Do nothing 30 | } 31 | } 32 | 33 | public override bool NewGenerator { 34 | get { 35 | return true; 36 | } 37 | set { 38 | // Do nothing 39 | } 40 | } 41 | 42 | public override string FullResourceName { 43 | get { 44 | return "CrystalReportWebAPI.Reports.Financial.TrialBalance.rpt"; 45 | } 46 | set { 47 | // Do nothing 48 | } 49 | } 50 | 51 | [Browsable(false)] 52 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 53 | public CrystalDecisions.CrystalReports.Engine.Section ReportHeaderSection2 { 54 | get { 55 | return this.ReportDefinition.Sections[0]; 56 | } 57 | } 58 | 59 | [Browsable(false)] 60 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 61 | public CrystalDecisions.CrystalReports.Engine.Section ReportHeaderSection1 { 62 | get { 63 | return this.ReportDefinition.Sections[1]; 64 | } 65 | } 66 | 67 | [Browsable(false)] 68 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 69 | public CrystalDecisions.CrystalReports.Engine.Section PageHeaderSection1 { 70 | get { 71 | return this.ReportDefinition.Sections[2]; 72 | } 73 | } 74 | 75 | [Browsable(false)] 76 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 77 | public CrystalDecisions.CrystalReports.Engine.Section DetailSection1 { 78 | get { 79 | return this.ReportDefinition.Sections[3]; 80 | } 81 | } 82 | 83 | [Browsable(false)] 84 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 85 | public CrystalDecisions.CrystalReports.Engine.Section ReportFooterSection2 { 86 | get { 87 | return this.ReportDefinition.Sections[4]; 88 | } 89 | } 90 | 91 | [Browsable(false)] 92 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 93 | public CrystalDecisions.CrystalReports.Engine.Section ReportFooterSection1 { 94 | get { 95 | return this.ReportDefinition.Sections[5]; 96 | } 97 | } 98 | 99 | [Browsable(false)] 100 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 101 | public CrystalDecisions.CrystalReports.Engine.Section PageFooterSection1 { 102 | get { 103 | return this.ReportDefinition.Sections[6]; 104 | } 105 | } 106 | 107 | [Browsable(false)] 108 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 109 | public CrystalDecisions.Shared.IParameterField Parameter_end_date { 110 | get { 111 | return this.DataDefinition.ParameterFields[0]; 112 | } 113 | } 114 | } 115 | 116 | [System.Drawing.ToolboxBitmapAttribute(typeof(CrystalDecisions.Shared.ExportOptions), "report.bmp")] 117 | public class CachedTrialBalance : Component, ICachedReport { 118 | 119 | public CachedTrialBalance() { 120 | } 121 | 122 | [Browsable(false)] 123 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 124 | public virtual bool IsCacheable { 125 | get { 126 | return true; 127 | } 128 | set { 129 | // 130 | } 131 | } 132 | 133 | [Browsable(false)] 134 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 135 | public virtual bool ShareDBLogonInfo { 136 | get { 137 | return false; 138 | } 139 | set { 140 | // 141 | } 142 | } 143 | 144 | [Browsable(false)] 145 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 146 | public virtual System.TimeSpan CacheTimeOut { 147 | get { 148 | return CachedReportConstants.DEFAULT_TIMEOUT; 149 | } 150 | set { 151 | // 152 | } 153 | } 154 | 155 | public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { 156 | TrialBalance rpt = new TrialBalance(); 157 | rpt.Site = this.Site; 158 | return rpt; 159 | } 160 | 161 | public virtual string GetCustomizedCacheKey(RequestContext request) { 162 | String key = null; 163 | // // The following is the code used to generate the default 164 | // // cache key for caching report jobs in the ASP.NET Cache. 165 | // // Feel free to modify this code to suit your needs. 166 | // // Returning key == null causes the default cache key to 167 | // // be generated. 168 | // 169 | // key = RequestContext.BuildCompleteCacheKey( 170 | // request, 171 | // null, // sReportFilename 172 | // this.GetType(), 173 | // this.ShareDBLogonInfo ); 174 | return key; 175 | } 176 | } 177 | } 178 | -------------------------------------------------------------------------------- /CrystalReportWebAPI/Reports/Financial/TrialBalance.rpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workcontrolgit/CrystalReportWebAPI/672305af39b0801f4bd1e679a785687b5dc765d6/CrystalReportWebAPI/Reports/Financial/TrialBalance.rpt -------------------------------------------------------------------------------- /CrystalReportWebAPI/Reports/Financial/VarianceAnalysisReport.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace CrystalReportWebAPI.Reports.Financial { 12 | using System; 13 | using System.ComponentModel; 14 | using CrystalDecisions.Shared; 15 | using CrystalDecisions.ReportSource; 16 | using CrystalDecisions.CrystalReports.Engine; 17 | 18 | 19 | public class VarianceAnalysisReport : ReportClass { 20 | 21 | public VarianceAnalysisReport() { 22 | } 23 | 24 | public override string ResourceName { 25 | get { 26 | return "VarianceAnalysisReport.rpt"; 27 | } 28 | set { 29 | // Do nothing 30 | } 31 | } 32 | 33 | public override bool NewGenerator { 34 | get { 35 | return true; 36 | } 37 | set { 38 | // Do nothing 39 | } 40 | } 41 | 42 | public override string FullResourceName { 43 | get { 44 | return "CrystalReportWebAPI.Reports.Financial.VarianceAnalysisReport.rpt"; 45 | } 46 | set { 47 | // Do nothing 48 | } 49 | } 50 | 51 | [Browsable(false)] 52 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 53 | public CrystalDecisions.CrystalReports.Engine.Section ReportHeaderSection2 { 54 | get { 55 | return this.ReportDefinition.Sections[0]; 56 | } 57 | } 58 | 59 | [Browsable(false)] 60 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 61 | public CrystalDecisions.CrystalReports.Engine.Section ReportHeaderSection1 { 62 | get { 63 | return this.ReportDefinition.Sections[1]; 64 | } 65 | } 66 | 67 | [Browsable(false)] 68 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 69 | public CrystalDecisions.CrystalReports.Engine.Section PageHeaderSection1 { 70 | get { 71 | return this.ReportDefinition.Sections[2]; 72 | } 73 | } 74 | 75 | [Browsable(false)] 76 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 77 | public CrystalDecisions.CrystalReports.Engine.Section DetailSection1 { 78 | get { 79 | return this.ReportDefinition.Sections[3]; 80 | } 81 | } 82 | 83 | [Browsable(false)] 84 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 85 | public CrystalDecisions.CrystalReports.Engine.Section ReportFooterSection2 { 86 | get { 87 | return this.ReportDefinition.Sections[4]; 88 | } 89 | } 90 | 91 | [Browsable(false)] 92 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 93 | public CrystalDecisions.CrystalReports.Engine.Section PageFooterSection2 { 94 | get { 95 | return this.ReportDefinition.Sections[5]; 96 | } 97 | } 98 | 99 | [Browsable(false)] 100 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 101 | public CrystalDecisions.Shared.IParameterField Parameter_end_date { 102 | get { 103 | return this.DataDefinition.ParameterFields[0]; 104 | } 105 | } 106 | } 107 | 108 | [System.Drawing.ToolboxBitmapAttribute(typeof(CrystalDecisions.Shared.ExportOptions), "report.bmp")] 109 | public class CachedVarianceAnalysisReport : Component, ICachedReport { 110 | 111 | public CachedVarianceAnalysisReport() { 112 | } 113 | 114 | [Browsable(false)] 115 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 116 | public virtual bool IsCacheable { 117 | get { 118 | return true; 119 | } 120 | set { 121 | // 122 | } 123 | } 124 | 125 | [Browsable(false)] 126 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 127 | public virtual bool ShareDBLogonInfo { 128 | get { 129 | return false; 130 | } 131 | set { 132 | // 133 | } 134 | } 135 | 136 | [Browsable(false)] 137 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 138 | public virtual System.TimeSpan CacheTimeOut { 139 | get { 140 | return CachedReportConstants.DEFAULT_TIMEOUT; 141 | } 142 | set { 143 | // 144 | } 145 | } 146 | 147 | public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { 148 | VarianceAnalysisReport rpt = new VarianceAnalysisReport(); 149 | rpt.Site = this.Site; 150 | return rpt; 151 | } 152 | 153 | public virtual string GetCustomizedCacheKey(RequestContext request) { 154 | String key = null; 155 | // // The following is the code used to generate the default 156 | // // cache key for caching report jobs in the ASP.NET Cache. 157 | // // Feel free to modify this code to suit your needs. 158 | // // Returning key == null causes the default cache key to 159 | // // be generated. 160 | // 161 | // key = RequestContext.BuildCompleteCacheKey( 162 | // request, 163 | // null, // sReportFilename 164 | // this.GetType(), 165 | // this.ShareDBLogonInfo ); 166 | return key; 167 | } 168 | } 169 | } 170 | -------------------------------------------------------------------------------- /CrystalReportWebAPI/Reports/Financial/VarianceAnalysisReport.rpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workcontrolgit/CrystalReportWebAPI/672305af39b0801f4bd1e679a785687b5dc765d6/CrystalReportWebAPI/Reports/Financial/VarianceAnalysisReport.rpt -------------------------------------------------------------------------------- /CrystalReportWebAPI/Reports/Financial/YTDVarianceCrossTab.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace CrystalReportWebAPI.Reports.Financial { 12 | using System; 13 | using System.ComponentModel; 14 | using CrystalDecisions.Shared; 15 | using CrystalDecisions.ReportSource; 16 | using CrystalDecisions.CrystalReports.Engine; 17 | 18 | 19 | public class YTDVarianceCrossTab : ReportClass { 20 | 21 | public YTDVarianceCrossTab() { 22 | } 23 | 24 | public override string ResourceName { 25 | get { 26 | return "YTDVarianceCrossTab.rpt"; 27 | } 28 | set { 29 | // Do nothing 30 | } 31 | } 32 | 33 | public override bool NewGenerator { 34 | get { 35 | return true; 36 | } 37 | set { 38 | // Do nothing 39 | } 40 | } 41 | 42 | public override string FullResourceName { 43 | get { 44 | return "CrystalReportWebAPI.Reports.Financial.YTDVarianceCrossTab.rpt"; 45 | } 46 | set { 47 | // Do nothing 48 | } 49 | } 50 | 51 | [Browsable(false)] 52 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 53 | public CrystalDecisions.CrystalReports.Engine.Section ReportHeaderSection2 { 54 | get { 55 | return this.ReportDefinition.Sections[0]; 56 | } 57 | } 58 | 59 | [Browsable(false)] 60 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 61 | public CrystalDecisions.CrystalReports.Engine.Section ReportHeaderSection1 { 62 | get { 63 | return this.ReportDefinition.Sections[1]; 64 | } 65 | } 66 | 67 | [Browsable(false)] 68 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 69 | public CrystalDecisions.CrystalReports.Engine.Section PageHeaderSection1 { 70 | get { 71 | return this.ReportDefinition.Sections[2]; 72 | } 73 | } 74 | 75 | [Browsable(false)] 76 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 77 | public CrystalDecisions.CrystalReports.Engine.Section DetailSection1 { 78 | get { 79 | return this.ReportDefinition.Sections[3]; 80 | } 81 | } 82 | 83 | [Browsable(false)] 84 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 85 | public CrystalDecisions.CrystalReports.Engine.Section ReportFooterSection1 { 86 | get { 87 | return this.ReportDefinition.Sections[4]; 88 | } 89 | } 90 | 91 | [Browsable(false)] 92 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 93 | public CrystalDecisions.CrystalReports.Engine.Section PageFooterSection1 { 94 | get { 95 | return this.ReportDefinition.Sections[5]; 96 | } 97 | } 98 | 99 | [Browsable(false)] 100 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 101 | public CrystalDecisions.Shared.IParameterField Parameter_end_date { 102 | get { 103 | return this.DataDefinition.ParameterFields[0]; 104 | } 105 | } 106 | } 107 | 108 | [System.Drawing.ToolboxBitmapAttribute(typeof(CrystalDecisions.Shared.ExportOptions), "report.bmp")] 109 | public class CachedYTDVarianceCrossTab : Component, ICachedReport { 110 | 111 | public CachedYTDVarianceCrossTab() { 112 | } 113 | 114 | [Browsable(false)] 115 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 116 | public virtual bool IsCacheable { 117 | get { 118 | return true; 119 | } 120 | set { 121 | // 122 | } 123 | } 124 | 125 | [Browsable(false)] 126 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 127 | public virtual bool ShareDBLogonInfo { 128 | get { 129 | return false; 130 | } 131 | set { 132 | // 133 | } 134 | } 135 | 136 | [Browsable(false)] 137 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 138 | public virtual System.TimeSpan CacheTimeOut { 139 | get { 140 | return CachedReportConstants.DEFAULT_TIMEOUT; 141 | } 142 | set { 143 | // 144 | } 145 | } 146 | 147 | public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { 148 | YTDVarianceCrossTab rpt = new YTDVarianceCrossTab(); 149 | rpt.Site = this.Site; 150 | return rpt; 151 | } 152 | 153 | public virtual string GetCustomizedCacheKey(RequestContext request) { 154 | String key = null; 155 | // // The following is the code used to generate the default 156 | // // cache key for caching report jobs in the ASP.NET Cache. 157 | // // Feel free to modify this code to suit your needs. 158 | // // Returning key == null causes the default cache key to 159 | // // be generated. 160 | // 161 | // key = RequestContext.BuildCompleteCacheKey( 162 | // request, 163 | // null, // sReportFilename 164 | // this.GetType(), 165 | // this.ShareDBLogonInfo ); 166 | return key; 167 | } 168 | } 169 | } 170 | -------------------------------------------------------------------------------- /CrystalReportWebAPI/Reports/Financial/YTDVarianceCrossTab.rpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workcontrolgit/CrystalReportWebAPI/672305af39b0801f4bd1e679a785687b5dc765d6/CrystalReportWebAPI/Reports/Financial/YTDVarianceCrossTab.rpt -------------------------------------------------------------------------------- /CrystalReportWebAPI/Reports/ReportData/balance_sheet1.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /CrystalReportWebAPI/Reports/ReportData/customer.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | -------------------------------------------------------------------------------- /CrystalReportWebAPI/Reports/ReportData/customer.xsx: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /CrystalReportWebAPI/Reports/ReportData/orders detail.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /CrystalReportWebAPI/Reports/ReportData/orders.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /CrystalReportWebAPI/Reports/ReportData/product type.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | -------------------------------------------------------------------------------- /CrystalReportWebAPI/Reports/ReportData/product.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | -------------------------------------------------------------------------------- /CrystalReportWebAPI/Reports/ReportData/variance_xtab.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /CrystalReportWebAPI/Reports/VersatileandPrecise/CollegeBoardPSAT9.rpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workcontrolgit/CrystalReportWebAPI/672305af39b0801f4bd1e679a785687b5dc765d6/CrystalReportWebAPI/Reports/VersatileandPrecise/CollegeBoardPSAT9.rpt -------------------------------------------------------------------------------- /CrystalReportWebAPI/Reports/VersatileandPrecise/FortifyFinancialAllinOneRetirementSavings.rpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workcontrolgit/CrystalReportWebAPI/672305af39b0801f4bd1e679a785687b5dc765d6/CrystalReportWebAPI/Reports/VersatileandPrecise/FortifyFinancialAllinOneRetirementSavings.rpt -------------------------------------------------------------------------------- /CrystalReportWebAPI/Reports/VersatileandPrecise/Invoice.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace CrystalReportWebAPI.Reports.VersatileandPrecise { 12 | using System; 13 | using System.ComponentModel; 14 | using CrystalDecisions.Shared; 15 | using CrystalDecisions.ReportSource; 16 | using CrystalDecisions.CrystalReports.Engine; 17 | 18 | 19 | public class Invoice : ReportClass { 20 | 21 | public Invoice() { 22 | } 23 | 24 | public override string ResourceName { 25 | get { 26 | return "Invoice.rpt"; 27 | } 28 | set { 29 | // Do nothing 30 | } 31 | } 32 | 33 | public override bool NewGenerator { 34 | get { 35 | return true; 36 | } 37 | set { 38 | // Do nothing 39 | } 40 | } 41 | 42 | public override string FullResourceName { 43 | get { 44 | return "CrystalReportWebAPI.Reports.VersatileandPrecise.Invoice.rpt"; 45 | } 46 | set { 47 | // Do nothing 48 | } 49 | } 50 | 51 | [Browsable(false)] 52 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 53 | public CrystalDecisions.CrystalReports.Engine.Section ReportHeaderSection2 { 54 | get { 55 | return this.ReportDefinition.Sections[0]; 56 | } 57 | } 58 | 59 | [Browsable(false)] 60 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 61 | public CrystalDecisions.CrystalReports.Engine.Section ReportHeaderSection1 { 62 | get { 63 | return this.ReportDefinition.Sections[1]; 64 | } 65 | } 66 | 67 | [Browsable(false)] 68 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 69 | public CrystalDecisions.CrystalReports.Engine.Section ReportHeaderSection5 { 70 | get { 71 | return this.ReportDefinition.Sections[2]; 72 | } 73 | } 74 | 75 | [Browsable(false)] 76 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 77 | public CrystalDecisions.CrystalReports.Engine.Section ReportHeaderSection3 { 78 | get { 79 | return this.ReportDefinition.Sections[3]; 80 | } 81 | } 82 | 83 | [Browsable(false)] 84 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 85 | public CrystalDecisions.CrystalReports.Engine.Section ReportHeaderSection4 { 86 | get { 87 | return this.ReportDefinition.Sections[4]; 88 | } 89 | } 90 | 91 | [Browsable(false)] 92 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 93 | public CrystalDecisions.CrystalReports.Engine.Section ReportHeaderSection6 { 94 | get { 95 | return this.ReportDefinition.Sections[5]; 96 | } 97 | } 98 | 99 | [Browsable(false)] 100 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 101 | public CrystalDecisions.CrystalReports.Engine.Section PageHeaderSection1 { 102 | get { 103 | return this.ReportDefinition.Sections[6]; 104 | } 105 | } 106 | 107 | [Browsable(false)] 108 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 109 | public CrystalDecisions.CrystalReports.Engine.Section DetailSection1 { 110 | get { 111 | return this.ReportDefinition.Sections[7]; 112 | } 113 | } 114 | 115 | [Browsable(false)] 116 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 117 | public CrystalDecisions.CrystalReports.Engine.Section ReportFooterSection1 { 118 | get { 119 | return this.ReportDefinition.Sections[8]; 120 | } 121 | } 122 | 123 | [Browsable(false)] 124 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 125 | public CrystalDecisions.CrystalReports.Engine.Section PageFooterSection1 { 126 | get { 127 | return this.ReportDefinition.Sections[9]; 128 | } 129 | } 130 | 131 | [Browsable(false)] 132 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 133 | public CrystalDecisions.Shared.IParameterField Parameter_clientID { 134 | get { 135 | return this.DataDefinition.ParameterFields[0]; 136 | } 137 | } 138 | 139 | [Browsable(false)] 140 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 141 | public CrystalDecisions.Shared.IParameterField Parameter_invDate { 142 | get { 143 | return this.DataDefinition.ParameterFields[1]; 144 | } 145 | } 146 | } 147 | 148 | [System.Drawing.ToolboxBitmapAttribute(typeof(CrystalDecisions.Shared.ExportOptions), "report.bmp")] 149 | public class CachedInvoice : Component, ICachedReport { 150 | 151 | public CachedInvoice() { 152 | } 153 | 154 | [Browsable(false)] 155 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 156 | public virtual bool IsCacheable { 157 | get { 158 | return true; 159 | } 160 | set { 161 | // 162 | } 163 | } 164 | 165 | [Browsable(false)] 166 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 167 | public virtual bool ShareDBLogonInfo { 168 | get { 169 | return false; 170 | } 171 | set { 172 | // 173 | } 174 | } 175 | 176 | [Browsable(false)] 177 | [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] 178 | public virtual System.TimeSpan CacheTimeOut { 179 | get { 180 | return CachedReportConstants.DEFAULT_TIMEOUT; 181 | } 182 | set { 183 | // 184 | } 185 | } 186 | 187 | public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { 188 | Invoice rpt = new Invoice(); 189 | rpt.Site = this.Site; 190 | return rpt; 191 | } 192 | 193 | public virtual string GetCustomizedCacheKey(RequestContext request) { 194 | String key = null; 195 | // // The following is the code used to generate the default 196 | // // cache key for caching report jobs in the ASP.NET Cache. 197 | // // Feel free to modify this code to suit your needs. 198 | // // Returning key == null causes the default cache key to 199 | // // be generated. 200 | // 201 | // key = RequestContext.BuildCompleteCacheKey( 202 | // request, 203 | // null, // sReportFilename 204 | // this.GetType(), 205 | // this.ShareDBLogonInfo ); 206 | return key; 207 | } 208 | } 209 | } 210 | -------------------------------------------------------------------------------- /CrystalReportWebAPI/Reports/VersatileandPrecise/Invoice.rpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workcontrolgit/CrystalReportWebAPI/672305af39b0801f4bd1e679a785687b5dc765d6/CrystalReportWebAPI/Reports/VersatileandPrecise/Invoice.rpt -------------------------------------------------------------------------------- /CrystalReportWebAPI/Reports/VersatileandPrecise/chequereport.rpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workcontrolgit/CrystalReportWebAPI/672305af39b0801f4bd1e679a785687b5dc765d6/CrystalReportWebAPI/Reports/VersatileandPrecise/chequereport.rpt -------------------------------------------------------------------------------- /CrystalReportWebAPI/Reports/VersatileandPrecise/dunning.rpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workcontrolgit/CrystalReportWebAPI/672305af39b0801f4bd1e679a785687b5dc765d6/CrystalReportWebAPI/Reports/VersatileandPrecise/dunning.rpt -------------------------------------------------------------------------------- /CrystalReportWebAPI/Reports/VersatileandPrecise/invoiceshippingsimple.rpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workcontrolgit/CrystalReportWebAPI/672305af39b0801f4bd1e679a785687b5dc765d6/CrystalReportWebAPI/Reports/VersatileandPrecise/invoiceshippingsimple.rpt -------------------------------------------------------------------------------- /CrystalReportWebAPI/Reports/VersatileandPrecise/projecttimesheet.rpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workcontrolgit/CrystalReportWebAPI/672305af39b0801f4bd1e679a785687b5dc765d6/CrystalReportWebAPI/Reports/VersatileandPrecise/projecttimesheet.rpt -------------------------------------------------------------------------------- /CrystalReportWebAPI/Reports/VersatileandPrecise/screenshots.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workcontrolgit/CrystalReportWebAPI/672305af39b0801f4bd1e679a785687b5dc765d6/CrystalReportWebAPI/Reports/VersatileandPrecise/screenshots.pptx -------------------------------------------------------------------------------- /CrystalReportWebAPI/Utilities/ClientCacheWithEtagAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Net; 4 | using System.Net.Http; 5 | using System.Net.Http.Headers; 6 | using System.Security.Cryptography; 7 | using System.Text; 8 | using System.Threading; 9 | using System.Threading.Tasks; 10 | using System.Web.Http.Filters; 11 | 12 | namespace CrystalReportWebAPI.Utilities 13 | { 14 | /// 15 | /// Enables HTTP Response CacheControl management with ETag values. 16 | /// How to use ETag in Web API using action filter along with HttpResponseMessage 17 | /// https://stackoverflow.com/questions/20145140/how-to-use-etag-in-web-api-using-action-filter-along-with-httpresponsemessage/49169225#49169225 18 | /// 19 | public class ClientCacheWithEtagAttribute : ActionFilterAttribute 20 | { 21 | private readonly TimeSpan _clientCache; 22 | 23 | private readonly HttpMethod[] _supportedRequestMethods = { 24 | HttpMethod.Get, 25 | HttpMethod.Head 26 | }; 27 | 28 | /// 29 | /// Default constructor 30 | /// 31 | /// Indicates for how long the client should cache the response. The value is in seconds 32 | public ClientCacheWithEtagAttribute(int clientCacheInSeconds) 33 | { 34 | _clientCache = TimeSpan.FromSeconds(clientCacheInSeconds); 35 | } 36 | 37 | public override async Task OnActionExecutedAsync(HttpActionExecutedContext actionExecutedContext, CancellationToken cancellationToken) 38 | { 39 | if (!_supportedRequestMethods.Contains(actionExecutedContext.Request.Method)) 40 | { 41 | return; 42 | } 43 | if (actionExecutedContext.Response?.Content == null) 44 | { 45 | return; 46 | } 47 | 48 | var body = await actionExecutedContext.Response.Content.ReadAsStringAsync(); 49 | if (body == null) 50 | { 51 | return; 52 | } 53 | 54 | var computedEntityTag = GetETag(Encoding.UTF8.GetBytes(body)); 55 | 56 | if (actionExecutedContext.Request.Headers.IfNoneMatch.Any() 57 | && actionExecutedContext.Request.Headers.IfNoneMatch.First().Tag.Trim('"').Equals(computedEntityTag, StringComparison.InvariantCultureIgnoreCase)) 58 | { 59 | actionExecutedContext.Response.StatusCode = HttpStatusCode.NotModified; 60 | actionExecutedContext.Response.Content = null; 61 | } 62 | 63 | var cacheControlHeader = new CacheControlHeaderValue 64 | { 65 | Private = true, 66 | MaxAge = _clientCache 67 | }; 68 | 69 | actionExecutedContext.Response.Headers.ETag = new EntityTagHeaderValue($"\"{computedEntityTag}\"", false); 70 | actionExecutedContext.Response.Headers.CacheControl = cacheControlHeader; 71 | } 72 | 73 | private static string GetETag(byte[] contentBytes) 74 | { 75 | using (var md5 = MD5.Create()) 76 | { 77 | var hash = md5.ComputeHash(contentBytes); 78 | string hex = BitConverter.ToString(hash); 79 | return hex.Replace("-", ""); 80 | } 81 | } 82 | } 83 | } -------------------------------------------------------------------------------- /CrystalReportWebAPI/Utilities/CrystalReport.cs: -------------------------------------------------------------------------------- 1 | using CrystalDecisions.CrystalReports.Engine; 2 | using CrystalDecisions.Shared; 3 | using System.IO; 4 | using System.Net; 5 | using System.Net.Http; 6 | 7 | namespace CrystalReportWebAPI.Utilities 8 | { 9 | public static class CrystalReport 10 | { 11 | public static HttpResponseMessage RenderReport(string reportPath, string reportFileName, string exportFilename) 12 | { 13 | var rd = new ReportDocument(); 14 | 15 | rd.Load(Path.Combine(System.Web.Hosting.HostingEnvironment.MapPath(reportPath), reportFileName)); 16 | MemoryStream ms = new MemoryStream(); 17 | using (var stream = rd.ExportToStream(ExportFormatType.PortableDocFormat)) 18 | { 19 | stream.CopyTo(ms); 20 | } 21 | 22 | var result = new HttpResponseMessage(HttpStatusCode.OK) 23 | { 24 | Content = new ByteArrayContent(ms.ToArray()) 25 | }; 26 | result.Content.Headers.ContentDisposition = 27 | new System.Net.Http.Headers.ContentDispositionHeaderValue("attachment") 28 | { 29 | FileName = exportFilename 30 | }; 31 | result.Content.Headers.ContentType = 32 | new System.Net.Http.Headers.MediaTypeHeaderValue("application/pdf"); 33 | return result; 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /CrystalReportWebAPI/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | 
2 |

Crystal Report WebAPI

3 |

With SAP Crystal software solutions, you can create pixel-perfect, powerful, richly formatted, and dynamic reports from virtually any data source.

4 |

Learn more »

5 |
6 |
7 |
8 |

Getting started

9 |

ASP.NET Web API is a framework that makes it easy to build HTTP services that reach 10 | a broad range of clients, including browsers and mobile devices. ASP.NET Web API 11 | is an ideal platform for building RESTful applications on the .NET Framework.

12 |

Learn more »

13 |
14 |
15 |

Get more libraries

16 |

NuGet is a free Visual Studio extension that makes it easy to add, remove, and update libraries and tools in Visual Studio projects.

17 |

Learn more »

18 |
19 |
20 |

Web Hosting

21 |

You can easily find a web hosting company that offers the right mix of features and price for your applications.

22 |

Learn more »

23 |
24 |
-------------------------------------------------------------------------------- /CrystalReportWebAPI/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Error 6 | 7 | 8 |
9 |

Error.

10 |

An error occurred while processing your request.

11 |
12 | 13 | -------------------------------------------------------------------------------- /CrystalReportWebAPI/Views/Shared/_Layout.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | @ViewBag.Title 7 | @Styles.Render("~/Content/css") 8 | @Scripts.Render("~/bundles/modernizr") 9 | 10 | 11 | 30 |
31 | @RenderBody() 32 |
33 |
34 |

© @DateTime.Now.Year - My ASP.NET Application

35 |
36 |
37 | 38 | @Scripts.Render("~/bundles/jquery") 39 | @Scripts.Render("~/bundles/bootstrap") 40 | @RenderSection("scripts", required: false) 41 | 42 | -------------------------------------------------------------------------------- /CrystalReportWebAPI/Views/Web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 |
7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /CrystalReportWebAPI/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "~/Views/Shared/_Layout.cshtml"; 3 | } -------------------------------------------------------------------------------- /CrystalReportWebAPI/Web.Debug.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | -------------------------------------------------------------------------------- /CrystalReportWebAPI/Web.Release.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 17 | 18 | 19 | 30 | 31 | -------------------------------------------------------------------------------- /CrystalReportWebAPI/Web.config: -------------------------------------------------------------------------------- 1 |  2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /CrystalReportWebAPI/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workcontrolgit/CrystalReportWebAPI/672305af39b0801f4bd1e679a785687b5dc765d6/CrystalReportWebAPI/favicon.ico -------------------------------------------------------------------------------- /CrystalReportWebAPI/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workcontrolgit/CrystalReportWebAPI/672305af39b0801f4bd1e679a785687b5dc765d6/CrystalReportWebAPI/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /CrystalReportWebAPI/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workcontrolgit/CrystalReportWebAPI/672305af39b0801f4bd1e679a785687b5dc765d6/CrystalReportWebAPI/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /CrystalReportWebAPI/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workcontrolgit/CrystalReportWebAPI/672305af39b0801f4bd1e679a785687b5dc765d6/CrystalReportWebAPI/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /CrystalReportWebAPI/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workcontrolgit/CrystalReportWebAPI/672305af39b0801f4bd1e679a785687b5dc765d6/CrystalReportWebAPI/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /CrystalReportWebAPI/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | --------------------------------------------------------------------------------