How to use SearchSharedDataSet method of NBi.Core.Report.DatabaseReportingParser class

Best NBi code snippet using NBi.Core.Report.DatabaseReportingParser.SearchSharedDataSet

DatabaseReportingParser.cs

Source:DatabaseReportingParser.cs Github

copy

Full Screen

...19 , request.DataSetName20 , ref otherDataSets);21 if (query == null)22 {23 var reference = SearchSharedDataSet(24 request.Source25 , request.Path26 , request.ReportName27 , request.DataSetName28 , ref otherDataSets);29 if (!string.IsNullOrEmpty(reference))30 query = ReadQueryFromSharedDataSet(request.Source, request.Path, reference);31 }32 if (query != null)33 return query;34 if (otherDataSets.Count() == 0)35 throw new ArgumentException(string.Format("No report found on path '{0}' with name '{1}'", request.Path, request.ReportName));36 else if (otherDataSets.Count() == 1)37 throw new ArgumentException(string.Format("The requested dataset ('{2}') wasn't found for the report on path '{0}' with name '{1}'. The dataset for this report is {3}", request.Path, request.ReportName, request.DataSetName, otherDataSets[0]));38 else39 throw new ArgumentException(string.Format("The requested dataset ('{2}') wasn't found for the report on path '{0}' with name '{1}'. The datasets for this report are {3}", request.Path, request.ReportName, request.DataSetName, String.Join(", ", otherDataSets.ToArray())));40 }41 public ReportingCommand ExtractCommand(SharedDatasetRequest request)42 {43 var query = ReadQueryFromSharedDataSet(request.Source, request.Path, request.SharedDatasetName);44 if (query != null)45 return query;46 throw new ArgumentException(string.Format("The requested shared dataset ('{1}') wasn't found on path '{0}'.", request.Path, request.SharedDatasetName));47 }48 private ReportingCommand SearchDataSet(string source, string reportPath, string reportName, string dataSetName, ref List<string> otherDataSets)49 {50 using (var conn = new SqlConnection())51 {52 //create connection and define sql query53 conn.ConnectionString = source;54 var cmd = new SqlCommand();55 cmd.Connection = conn;56 cmd.CommandText = ReadQueryFromContent("ListDataSet");57 //create the three parameters for the sql query58 var paramReportPath = new SqlParameter("ReportPath", System.Data.SqlDbType.NVarChar, 425);59 paramReportPath.Value = reportPath;60 cmd.Parameters.Add(paramReportPath);61 var paramReportName = new SqlParameter("ReportName", System.Data.SqlDbType.NVarChar, 425);62 paramReportName.Value = reportName;63 cmd.Parameters.Add(paramReportName);64 //execute the command65 conn.Open();66 var dr = cmd.ExecuteReader();67 68 while (dr.Read())69 if (dr.GetString(2) == dataSetName)70 {71 var command = new ReportingCommand();72 command.CommandType = (CommandType)Enum.Parse(typeof(CommandType), dr.GetString(4)); //CommandType73 command.Text = dr.GetString(5); //CommandText74 return command;75 }76 else77 otherDataSets.Add(dr.GetString(2));78 }79 return null;80 }81 private string SearchSharedDataSet(string source, string reportPath, string reportName, string dataSetName, ref List<string> otherDataSets)82 {83 using (var conn = new SqlConnection())84 {85 //create connection and define sql query86 conn.ConnectionString = source;87 var cmd = new SqlCommand();88 cmd.Connection = conn;89 cmd.CommandText = ReadQueryFromContent("ListSharedDataSet");90 //create the three parameters for the sql query91 var paramReportPath = new SqlParameter("ReportPath", System.Data.SqlDbType.NVarChar, 425);92 paramReportPath.Value = reportPath;93 cmd.Parameters.Add(paramReportPath);94 var paramReportName = new SqlParameter("ReportName", System.Data.SqlDbType.NVarChar, 425);95 paramReportName.Value = reportName;...

Full Screen

Full Screen

SearchSharedDataSet

Using AI Code Generation

copy

Full Screen

1using System;2using System.Collections.Generic;3using System.Linq;4using System.Text;5using System.Threading.Tasks;6using NBi.Core.Report;7{8 {9 static void Main(string[] args)10 {11 DatabaseReportingParser parser = new DatabaseReportingParser();12 string reportPath = @"C:\Users\username\Desktop\Report.rdl";13 string dataSetName = "Dataset1";14 parser.SearchSharedDataSet(reportPath, dataSetName);15 Console.ReadLine();16 }17 }18}

Full Screen

Full Screen

SearchSharedDataSet

Using AI Code Generation

copy

Full Screen

1using NBi.Core.Report;2using NBi.Core.Report.Datasource;3using System;4{5 {6 static void Main(string[] args)7 {8 var parser = new DatabaseReportingParser();9 var ds = new DatasourceInfo()10 {11 ConnectionString = "Data Source=.;Initial Catalog=AdventureWorks2012;Integrated Security=True",12 };13 var sharedDataSet = parser.SearchSharedDataSet(@"C:\Users\Public\Documents\NBi\Reports\3.rdl", ds);14 Console.WriteLine(sharedDataSet);15 Console.ReadLine();16 }17 }18}19using NBi.Core.Report;20using NBi.Core.Report.Datasource;21using System;22{23 {24 static void Main(string[] args)25 {26 var parser = new DatabaseReportingParser();27 var ds = new DatasourceInfo()28 {29 ConnectionString = "Data Source=.;Initial Catalog=AdventureWorks2012;Integrated Security=True",30 };31 var sharedDataSet = parser.SearchSharedDataSet(@"C:\Users\Public\Documents\NBi\Reports\4.rdl", ds);32 Console.WriteLine(sharedDataSet);33 Console.ReadLine();34 }35 }36}37using NBi.Core.Report;38using NBi.Core.Report.Datasource;39using System;40{41 {42 static void Main(string[] args)43 {44 var parser = new DatabaseReportingParser();45 var ds = new DatasourceInfo()46 {47 ConnectionString = "Data Source=.;Initial Catalog=AdventureWorks2012;Integrated Security=True",48 };49 var sharedDataSet = parser.SearchSharedDataSet(@"C:\Users\Public\Documents\NBi\Reports\5.rdl", ds);50 Console.WriteLine(sharedDataSet);51 Console.ReadLine();52 }53 }54}

Full Screen

Full Screen

SearchSharedDataSet

Using AI Code Generation

copy

Full Screen

1using System;2using System.Collections.Generic;3using System.Linq;4using System.Text;5using System.Threading.Tasks;6using NBi.Core.Report;7using NBi.Core.Report.Datasource;8using NBi.Core.DataSerialization.Flattening;9{10 {11 static void Main(string[] args)12 {13 string reportPath = @"C:\Users\user\Desktop\NBI\SampleReports\AdventureWorks.rdl";14 DatabaseReportingParser parser = new DatabaseReportingParser(reportPath, new FlatFileEngine());15 var ds = parser.SearchSharedDataSet();16 Console.WriteLine(ds.Count);17 Console.ReadLine();18 }19 }20}

Full Screen

Full Screen

SearchSharedDataSet

Using AI Code Generation

copy

Full Screen

1using System;2using System.Collections.Generic;3using System.Linq;4using System.Text;5using System.Threading.Tasks;6using NBi.Core.Report;7{8 {9 static void Main(string[] args)10 {11 string reportPath = @"C:\Users\Public\Documents\SSRS\Report1.rdl";12 string sharedDataSetName = "SharedDataSet1";13 DatabaseReportingParser parser = new DatabaseReportingParser(reportPath);14 var sharedDataSet = parser.SearchSharedDataSet(sharedDataSetName);15 }16 }17}18Error 1 The type or namespace name 'NBi' could not be found (are you missing a using directive or an assembly reference?) C:\Users\Public\Documents\SSRS\3.cs 4 7 ConsoleApplication1

Full Screen

Full Screen

SearchSharedDataSet

Using AI Code Generation

copy

Full Screen

1using NBi.Core.Report;2using NBi.Core.Report.Datasource;3using NBi.Core.Report.Datasource.Connection;4using NBi.Core.Report.Datasource.ODBC;5using NBi.Core.Report.Datasource.SQL;6using NBi.Core.Report.Datasource.Xml;7using NBi.Core.Report.Xml;8using NBi.Core.Report.Xml.Format;9using System;10using System.Collections.Generic;11using System.Data;12using System.Data.SqlClient;13using System.Linq;14using System.Text;15using System.Threading.Tasks;16using System.Xml;17{18 {19 static void Main(string[] args)20 {21 string reportPath = "C:\\Users\\Sachin\\Desktop\\Report.rdl";22 string connectionString = "Data Source=.;Initial Catalog=AdventureWorks2012;Integrated Security=True";23 ReportingParser parser = new ReportingParser();24 var result = parser.SearchSharedDataSet(reportPath, connectionString);25 foreach (var item in result)26 {27 Console.WriteLine(item);28 }29 Console.ReadLine();30 }31 }32}

Full Screen

Full Screen

SearchSharedDataSet

Using AI Code Generation

copy

Full Screen

1var parser = new NBi.Core.Report.DatabaseReportingParser();2var dataset = parser.SearchSharedDataSet("3.rdl", "MyDataSet");3var table = dataset.Tables["MyTable"];4var parser = new NBi.Core.Report.ReportingParser();5var dataset = parser.SearchSharedDataSet("3.rdl", "MyDataSet");6var table = dataset.Tables["MyTable"];7var parser = new NBi.Core.Report.ReportingParser();8var dataset = parser.SearchSharedDataSet("3.rdl", "MyDataSet");9var table = dataset.Tables["MyTable"];10var parser = new NBi.Core.Report.ReportingParser();11var dataset = parser.SearchSharedDataSet("3.rdl", "MyDataSet");12var table = dataset.Tables["MyTable"];13var parser = new NBi.Core.Report.ReportingParser();14var dataset = parser.SearchSharedDataSet("3.rdl", "MyDataSet");15var table = dataset.Tables["MyTable"];16var parser = new NBi.Core.Report.ReportingParser();17var dataset = parser.SearchSharedDataSet("3.rdl", "MyDataSet");18var table = dataset.Tables["MyTable"];19var parser = new NBi.Core.Report.ReportingParser();20var dataset = parser.SearchSharedDataSet("3.rdl", "MyDataSet");21var table = dataset.Tables["MyTable"];22var parser = new NBi.Core.Report.ReportingParser();23var dataset = parser.SearchSharedDataSet("3.rdl", "MyDataSet");24var table = dataset.Tables["MyTable"];

Full Screen

Full Screen

SearchSharedDataSet

Using AI Code Generation

copy

Full Screen

1using System;2using System.Collections.Generic;3using System.Linq;4using System.Text;5using System.Threading.Tasks;6using NBi.Core.Report;7{8 {9 static void Main(string[] args)10 {11 bool isSharedDataSetFound = false;12 string reportPath = @"C:\Users\Public\Documents\NBi\NBiTest\NBiTest\Report.rdl";13 string sharedDataSetName = "SharedDataSet";14 DatabaseReportingParser parser = new DatabaseReportingParser(reportPath);15 isSharedDataSetFound = parser.SearchSharedDataSet(sharedDataSetName);16 Console.WriteLine("Is shared dataset found: {0}", isSharedDataSetFound);17 Console.ReadKey();18 }19 }20}

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run NBi automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful