Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature(REPORT-10918): Bold-reports 4.1 release changes #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 15 additions & 13 deletions Controllers/demos/ReportDesignerWebApiController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ namespace ReportServices.Controllers.demos
[RoutePrefix("")]
public class ReportDesignerWebApiController : ApiController, IReportDesignerController, IReportLogger, IReportHelperSettings
{
const string CachePath = "Cache\\";

internal ReportHelperSettings _helperSettings = null;

Expand Down Expand Up @@ -156,20 +155,13 @@ public object GetResource(string key, string resourcetype, bool isPrint)

private string GetFilePath(string itemName, string key)
{
string targetFolder = HttpContext.Current.Server.MapPath("~/");
targetFolder += "Cache";

if (!Directory.Exists(targetFolder))
{
Directory.CreateDirectory(targetFolder);
}

if (!Directory.Exists(targetFolder + "\\" + key))
string dirPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory,"Cache",key);
if (!Directory.Exists(dirPath))
{
Directory.CreateDirectory(targetFolder + "\\" + key);
Directory.CreateDirectory(dirPath);
}

return targetFolder + "\\" + key + "\\" + itemName;
return Path.Combine(dirPath, itemName);
}

public bool SetData(string key, string itemId, ItemInfo itemData, out string errMsg)
Expand Down Expand Up @@ -205,7 +197,17 @@ public ResourceInfo GetData(string key, string itemId)
var resource = new ResourceInfo();
try
{
resource.Data = File.ReadAllBytes(this.GetFilePath(itemId, key));
var filePath = this.GetFilePath(itemId, key);
if (itemId.Equals(Path.GetFileName(filePath), StringComparison.InvariantCultureIgnoreCase) && File.Exists(filePath))
{
resource.Data = File.ReadAllBytes(filePath);
LogExtension.LogInfo(string.Format("Method Name: {0}; Class Name: {1}; Message: {2};", "GetData", "CacheHelper", string.Format("File data retrieved from the path: {0}", filePath)), null);
}
else
{
resource.ErrorMessage = "File not found from the specified path";
LogExtension.LogInfo(string.Format("Method Name: {0}; Class Name: {1}; Message: {2};", "GetData", "CacheHelper", string.Format("File not found from the specified path: {0}", filePath)), null);
}
}
catch (Exception ex)
{
Expand Down
8 changes: 8 additions & 0 deletions Controllers/demos/ReportViewerWebApiController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,13 @@ public object PostReportAction(Dictionary<string, object> jsonResult)
{
return ReportHelper.ProcessReport(jsonResult, this);
}

[HttpGet]
public object GetExternalParameterData()
{
var productCategory = SqlQuery.getProductCategory();
var productSubCategory = SqlQuery.getProductSubCategory();
return Json(new { ProductCategoryDetail = productCategory, ProductSubCategoryDetail=productSubCategory });
}
}
}
37 changes: 37 additions & 0 deletions Models/SqlQuery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,42 @@ public static string getJson()
}
return null;
}
public static string getProductCategory()
{

using (SqlConnection connection = new SqlConnection("Data Source=dataplatformdemodata.syncfusion.com;Initial Catalog=AdventureWorks2016;user id=demoreadonly@data-platform-demo;password=N@c)=Y8s*1&dh;"))
{
connection.Open();

string queryString = "SELECT DISTINCT ProductCategoryID, Name FROM Production.ProductCategory";
SqlDataAdapter adapter = new SqlDataAdapter(queryString, connection);

using (DataSet ProductCategories = new DataSet())
{
adapter.Fill(ProductCategories, "Orders");
HttpContext.Current.Cache.Insert("ProductCategoryDetail", ProductCategories.Tables[0]);
connection.Close();
return JsonConvert.SerializeObject(HttpContext.Current.Cache.Get("ProductCategoryDetail"));
}
}
}

public static string getProductSubCategory()
{
using (SqlConnection connection = new SqlConnection("Data Source=dataplatformdemodata.syncfusion.com;Initial Catalog=AdventureWorks2016;user id=demoreadonly@data-platform-demo;password=N@c)=Y8s*1&dh;"))
{
connection.Open();
string queryString = $"SELECT ProductSubcategoryID, ProductCategoryID, Name FROM Production.ProductSubcategory ";
SqlDataAdapter adapter = new SqlDataAdapter(queryString, connection);

using (DataSet ProductSubCategories = new DataSet())
{
adapter.Fill(ProductSubCategories);
HttpContext.Current.Cache.Insert("ProductSubCategoryDetail", ProductSubCategories.Tables[0]);
connection.Close();
return JsonConvert.SerializeObject(HttpContext.Current.Cache.Get("ProductSubCategoryDetail"));
}
}
}
}
}
Binary file removed NuGet/BoldReports.Base.Logger.3.3.23.nupkg
Binary file not shown.
Binary file added NuGet/BoldReports.Base.Logger.4.1.78.nupkg
Binary file not shown.
Binary file removed NuGet/BoldReports.CRI.Barcode.3.3.23.nupkg
Binary file not shown.
Binary file added NuGet/BoldReports.CRI.Barcode.4.1.78.nupkg
Binary file not shown.
6 changes: 3 additions & 3 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ReportServices")]
[assembly: AssemblyCopyright("Copyright © 2001 - 2021 Syncfusion Inc.")]
[assembly: AssemblyCopyright("Copyright © 2001 - 2022 Syncfusion Inc.")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: log4net.Config.XmlConfigurator(ConfigFile = "log4net.config")]
Expand All @@ -31,5 +31,5 @@
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("3.3.23")]
[assembly: AssemblyFileVersion("3.3.23")]
[assembly: AssemblyVersion("4.1.78")]
[assembly: AssemblyFileVersion("4.1.78")]
21 changes: 12 additions & 9 deletions ReportServices.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.0\build\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props" Condition="Exists('packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.0\build\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
Expand Down Expand Up @@ -48,29 +48,29 @@
<HintPath>packages\BarcodeLib.1.3.0.0\lib\net20\BarcodeLib.dll</HintPath>
</Reference>
<Reference Include="Bold.Licensing">
<HintPath>packages\Bold.Licensing.3.3.23\lib\net45\Bold.Licensing.dll</HintPath>
<HintPath>packages\Bold.Licensing.4.1.78\lib\net45\Bold.Licensing.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="BoldReports.CRI.Barcode">
<HintPath>packages\BoldReports.CRI.Barcode.3.3.23\lib\net45\BoldReports.CRI.Barcode.dll</HintPath>
<HintPath>packages\BoldReports.CRI.Barcode.4.1.78\lib\net45\BoldReports.CRI.Barcode.dll</HintPath>
</Reference>
<Reference Include="BoldReports.Data.SSAS">
<HintPath>packages\BoldReports.Data.SSAS.3.3.23\lib\net45\BoldReports.Data.SSAS.dll</HintPath>
<HintPath>packages\BoldReports.Data.SSAS.4.1.78\lib\net45\BoldReports.Data.SSAS.dll</HintPath>
</Reference>
<Reference Include="BoldReports.Web">
<HintPath>packages\BoldReports.Web.3.3.23\lib\net45\BoldReports.Web.dll</HintPath>
<HintPath>packages\BoldReports.Web.4.1.78\lib\net45\BoldReports.Web.dll</HintPath>
</Reference>
<Reference Include="BoldReports.Data.Csv">
<HintPath>packages\BoldReports.Data.Csv.3.3.23\lib\net45\BoldReports.Data.Csv.dll</HintPath>
<HintPath>packages\BoldReports.Data.Csv.4.1.78\lib\net45\BoldReports.Data.Csv.dll</HintPath>
</Reference>
<Reference Include="BoldReports.Data.Excel">
<HintPath>packages\BoldReports.Data.Excel.3.3.23\lib\net45\BoldReports.Data.Excel.dll</HintPath>
<HintPath>packages\BoldReports.Data.Excel.4.1.78\lib\net45\BoldReports.Data.Excel.dll</HintPath>
</Reference>
<Reference Include="KBCsv, Version=5.0.0.0, Culture=neutral, PublicKeyToken=cc96fa93a217f7a1, processorArchitecture=MSIL">
<HintPath>packages\KBCsv.5.0.0\lib\netstandard1.0\KBCsv.dll</HintPath>
</Reference>
<Reference Include="BoldReports.Data.WebData">
<HintPath>packages\BoldReports.Data.WebData.3.3.23\lib\net45\BoldReports.Data.WebData.dll</HintPath>
<HintPath>packages\BoldReports.Data.WebData.4.1.78\lib\net45\BoldReports.Data.WebData.dll</HintPath>
</Reference>
<Reference Include="log4net, Version=2.0.9.0">
<HintPath>packages\log4net.2.0.10\lib\net45\log4net.dll</HintPath>
Expand Down Expand Up @@ -101,7 +101,7 @@
<HintPath>packages\Syncfusion.Presentation.AspNet.19.2.0.44\lib\net45\Syncfusion.Presentation.Base.dll</HintPath>
</Reference>
<Reference Include="BoldReports.Base.Logger">
<HintPath>packages\BoldReports.Base.Logger.3.3.23\lib\net45\BoldReports.Base.Logger.dll</HintPath>
<HintPath>packages\BoldReports.Base.Logger.4.1.78\lib\net45\BoldReports.Base.Logger.dll</HintPath>
</Reference>
<Reference Include="Syncfusion.SfBarcode.WPF">
<HintPath>packages\Syncfusion.SfBarcode.WPF.19.2.0.44\lib\net45\Syncfusion.SfBarcode.WPF.dll</HintPath>
Expand Down Expand Up @@ -385,6 +385,9 @@
<Content Include="Resources\demos\Report\consolidated-balance-sheet.rdlc" />
<Content Include="Resources\demos\Report\paystub.rdlc" />
<Content Include="Resources\demos\Report\dynamic-chart-series.rdl" />
<Content Include="Resources\demos\Report\dynamic-columns.rdl" />
<Content Include="Resources\demos\Report\data-bar.rdl" />
<Content Include="Resources\demos\Report\spark-line.rdlc" />
<None Include="Web.Debug.config">
<DependentUpon>Web.config</DependentUpon>
</None>
Expand Down
2 changes: 1 addition & 1 deletion Resources/demos/Report/consolidated-balance-sheet.rdlc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<Paragraph>
<TextRuns>
<TextRun>
<Value>For the Last 4 Quaters</Value>
<Value>For the Last 4 Quarters</Value>
<Style>
<FontSize>0.15972in</FontSize>
<FontWeight>Bold</FontWeight>
Expand Down
Loading