# pqLoadDataReaction in custom application

**URL:** https://discourse.paraview.org/t/pqloaddatareaction-in-custom-application/9230
**Category:** Development
**Created:** [March 20, 2022, 11:55am UTC](https://discourse.paraview.org/t/pqloaddatareaction-in-custom-application/9230 "2022-03-20T11:55:37Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![fvitello](https://discourse.paraview.org/user_avatar/discourse.paraview.org/fvitello/32/8783_2.png) [@fvitello](https://discourse.paraview.org/u/fvitello)
#### Post date: [March 20, 2022, 11:55am UTC](https://discourse.paraview.org/t/pqloaddatareaction-in-custom-application/9230/1 "2022-03-20T11:55:37Z")

</div>

Hi all,

i am trying to implement my first custom application based on paraview and I have defined a pqLoadDataReaction linked to a QAction.

`pqLoadDataReaction* dataLoader = new pqLoadDataReaction(ui.actionOpen);`

When I execute my app, triggering the action I obtain the following error:

`**Assertion failed: (filters.isEmpty()), function loadData, file pqLoadDataReaction.cxx, line 86.**`

I think it is related to an empty response from readerFactory-\>GetSupportedFileTypes.

How I can define the supported file types of my application?

---

<div class="post-metadata">

### Author: ![utkarsh.ayachit](https://discourse.paraview.org/user_avatar/discourse.paraview.org/utkarsh.ayachit/32/39_2.png) [@utkarsh.ayachit](https://discourse.paraview.org/u/utkarsh.ayachit)
#### Post date: [March 20, 2022, 12:56pm UTC](https://discourse.paraview.org/t/pqloaddatareaction-in-custom-application/9230/2 "2022-03-20T12:56:18Z")

</div>

Try calling `pqApplicationCore::updateAvailableReadersAndWriters` explicitly during application startup. I suspect for some reason it’s being called during initialization.

---

<div class="post-metadata">

### Author: ![fvitello](https://discourse.paraview.org/user_avatar/discourse.paraview.org/fvitello/32/8783_2.png) [@fvitello](https://discourse.paraview.org/u/fvitello)
#### Post date: [March 20, 2022, 3:52pm UTC](https://discourse.paraview.org/t/pqloaddatareaction-in-custom-application/9230/3 "2022-03-20T15:52:45Z")

</div>

I have solved with

```auto
    readerFactory->RegisterPrototype("sources", "XMLPolyDataReader");

```

---

<div class="post-metadata">

### Author: ![fvitello](https://discourse.paraview.org/user_avatar/discourse.paraview.org/fvitello/32/8783_2.png) [@fvitello](https://discourse.paraview.org/u/fvitello)
#### Post date: [March 20, 2022, 5:05pm UTC](https://discourse.paraview.org/t/pqloaddatareaction-in-custom-application/9230/4 "2022-03-20T17:05:13Z")

</div>

I am now trying to visualize data with a custom reader for Fits format files with this code:

```auto
    pqObjectBuilder *builder = pqApplicationCore::instance()->getObjectBuilder();
    pqDataRepresentation *drep = builder->createDataRepresentation(
    this->originSource->getOutputPort(0), this->view);
    vtkSMPropertyHelper(drep->getProxy(), "Representation").Set(VTK_SURFACE);
    drep->getProxy()->UpdateVTKObjects();
    
    this->view->resetDisplay();
    this->view->render();

```

But I obtain this error:

**vtkPVCompositeRepresentation (0x16f473ff0): No representation was found with Name: 2**

UPDATE: I realised that only Outline representation is available, How can I create other type of representation?

---

<div class="post-metadata">

### Author: ![utkarsh.ayachit](https://discourse.paraview.org/user_avatar/discourse.paraview.org/utkarsh.ayachit/32/39_2.png) [@utkarsh.ayachit](https://discourse.paraview.org/u/utkarsh.ayachit)
#### Post date: [March 21, 2022, 11:41am UTC](https://discourse.paraview.org/t/pqloaddatareaction-in-custom-application/9230/5 "2022-03-21T11:41:29Z")

</div>

“Representation” is a string property. The values it accepts are the string e.g. `"Surface"`, `"Wireframe"`, etc. and not enums.

---

<div class="post-metadata">

### Author: ![fvitello](https://discourse.paraview.org/user_avatar/discourse.paraview.org/fvitello/32/8783_2.png) [@fvitello](https://discourse.paraview.org/u/fvitello)
#### Post date: [March 21, 2022, 1:50pm UTC](https://discourse.paraview.org/t/pqloaddatareaction-in-custom-application/9230/6 "2022-03-21T13:50:42Z")

</div>

Thanks
