0

I am using designer of Activereports library in my React application. In the Data source section of the Designer, it offers me two options as data provider, these are Remote JSON and Embedded JSON. And it asks me to enter the endpoint. I want to remove the Datasource part of the designer and add my own datasource to show only the attached databases in the designer.

I tried this ;

import { Designer } from "@grapecity/activereports-react";
import "./App.css";
import GrapeCity from "@grapecity/activereports/core";

class MyCustomDataProvider extends GrapeCity.ActiveReports.Data
  .DataProviderBase {
  constructor() {
    super();
  }

  getData(dataSet, report, parameters) {
    const data = [
      { Id: 1, Name: "John Doe", Age: 32 },
      { Id: 2, Name: "Jane Smith", Age: 27 },
      { Id: 3, Name: "Bob Johnson", Age: 45 },
    ];
    dataSet.loadData(data);
  }
}

const myDataProvider = new MyCustomDataProvider();

const designer = new GrapeCity.ActiveReports.Design.Designer({
  dataSourceProviders: [
    {
      name: "My Custom Data Provider",
      value: myDataProvider,
    },
  ],
});

export default function App() {
  return <Designer designer={designer} />;
}

but I am getting this error ;

export 'default' (imported as 'GrapeCity') was not found in '@grapecity/activereports/core' (possible exports: CultureInfo, FontStore, PageDocument, PageReport, Rdl, VDomRenderer, Version, __esModule, arjsStyles, getLicenseKey, noValue, rdlxParams, readDataRecords, registerFont, selectAll, setLicenseKey, withLocalizedErrors, withLocalizedErrorsAsync)

I have tried install activereports-core library with npm install @grapecity/activereports-core but it doesn't exist. I'm not quite sure what to do to change the datasource section in Designer and add my own datasource. I would be glad if you help.

user
  • 1
  • 3

0 Answers0